[svk-commit] r2175 - in trunk: t

clkao at bestpractical.com clkao at bestpractical.com
Sat Nov 18 16:24:12 EST 2006


Author: clkao
Date: Sat Nov 18 16:24:11 2006
New Revision: 2175

Modified:
   trunk/lib/SVK/Path/View.pm
   trunk/t/74view-mirror.t

Log:
more todo tests for view.

Modified: trunk/lib/SVK/Path/View.pm
==============================================================================
--- trunk/lib/SVK/Path/View.pm	(original)
+++ trunk/lib/SVK/Path/View.pm	Sat Nov 18 16:24:11 2006
@@ -99,4 +99,10 @@
     return '/'.$self->depotname.$self->view->spec;
 }
 
+sub universal { $_[0]->source->universal }
+
+sub normalize {  # SVK::Path normalize is not view safe
+    return $_[0];
+}
+
 1;

Modified: trunk/t/74view-mirror.t
==============================================================================
--- trunk/t/74view-mirror.t	(original)
+++ trunk/t/74view-mirror.t	Sat Nov 18 16:24:11 2006
@@ -2,7 +2,7 @@
 use strict;
 
 use SVK::Test;
-plan tests => 19;
+plan tests => 22;
 our $output;
 
 # build another tree to be mirrored ourself
@@ -17,12 +17,12 @@
 $svk->ps ('-m', 'my view', 'svk:view:myview',
 	  '&:/project/trunk
  -*
- S   S
- V   V
- K   K
+ s   S
+ v   V
+ k   K
 ', '/test/project/trunk');
 is_output($svk, 'ls', ['/test/^project/trunk/myview'],
-	  ['K/', 'S/', 'V/']);
+	  ['k/', 's/', 'v/']);
 
 my ($srepospath, $spath, $srepos) =$xd->find_repos('/test/project', 1);
 my $suuid = $srepos->fs->get_uuid;
@@ -32,7 +32,7 @@
 $svk->sync('//prj');
 
 is_output($svk, 'ls', ['//^prj/trunk/myview'],
-	  ['K/', 'S/', 'V/']);
+	  ['k/', 's/', 'v/']);
 
 is_output($svk, 'co', ['//^prj/trunk/myview', $copath],
 	  ['Syncing //prj/trunk(/prj/trunk) in '.__($corpath).' to 27.',
@@ -42,14 +42,14 @@
 	      "A   $copath/$_/Q",
 	      "A   $copath/$_/Q/qu",
 	      "A   $copath/$_/Q/qz",
-	      "A   $copath/$_/be") } qw(S V K)),
+	      "A   $copath/$_/be") } qw(s v k)),
 	   " U  $copath",
 	  ]);
 
-is_output($svk, 'rm', ["$copath/K/Q/qu"],
-	  [__("D   $copath/K/Q/qu")]);
+is_output($svk, 'rm', ["$copath/k/Q/qu"],
+	  [__("D   $copath/k/Q/qu")]);
 
-is_output($svk, 'ci', [-m => 'kill Q', "$copath/K/Q"],
+is_output($svk, 'ci', [-m => 'kill Q', "$copath/k/Q"],
 	  ['Commit into mirrored path: merging back directly.',
 	   "Merging back to mirror source $uri/project.",
 	   'Merge back committed as revision 27.',
@@ -64,18 +64,17 @@
 $svk->ps ('-m', 'my local view', 'svk:view:viewA',
 	  '/prj/trunk
  -*
- S   S
- V   V
- K   K
+ s   S
+ v   V
+ k   K
 ', '//');
 
 is_output($svk, 'switch', ["//^viewA", $copath],
 	  ['Syncing //^prj/trunk/myview at 28(/prj/trunk) in '.__($corpath).' to 29.']);
+is_output($svk, 'rm', ["$copath/k/Q/qz"],
+	  [__("D   $copath/k/Q/qz")]);
 
-is_output($svk, 'rm', ["$copath/K/Q/qz"],
-	  [__("D   $copath/K/Q/qz")]);
-
-is_output($svk, 'ci', [-m => 'kill Q', "$copath/K/Q"],
+is_output($svk, 'ci', [-m => 'kill Q', "$copath/k/Q"],
 	  ['Commit into mirrored path: merging back directly.',
 	   "Merging back to mirror source $uri/project.",
 	   'Merge back committed as revision 28.',
@@ -86,20 +85,20 @@
 $svk->ps ('-m', 'swap V & K', 'svk:view:viewA',
 	  '/prj/trunk
  -*
- S   S
- V   K
- K   V
+ s   S
+ v   K
+ k   V
 ', '//');
 
 is_output($svk, 'up', [$copath],
 	  ['Syncing //^viewA at 29(/prj/trunk) in '.__($corpath).' to 31.',
 	   map { __($_) }
-	   "D   $copath/V/Q/qu",
-	   "D   $copath/V/Q/qz",
-	   "A   $copath/K/Q/qu",
-	   "A   $copath/K/Q/qz"]);
+	   "D   $copath/v/Q/qu",
+	   "D   $copath/v/Q/qz",
+	   "A   $copath/k/Q/qu",
+	   "A   $copath/k/Q/qz"]);
 
-append_file("$copath/K/Q/qu", "commit from view/K");
+append_file("$copath/k/Q/qu", "commit from view/K");
 
 is_output($svk, 'ci', [-m => 'foo', $copath],
 	  ['Commit into mirrored path: merging back directly.',
@@ -109,7 +108,7 @@
 	   'Retrieving log information from 29 to 29',
 	   'Committed revision 32 from revision 29.']);
 
-append_file("$copath/V/be", "commit from view/V");
+append_file("$copath/v/be", "commit from view/V");
 
 is_output($svk, 'ci', [-m => 'modify V', $copath],
 	  ['Commit into mirrored path: merging back directly.',
@@ -124,23 +123,23 @@
 $svk->ps ('-m', 'use local K for V', 'svk:view:viewA',
 	  '/prj/trunk
  -*
- S   S
- V   //local/K
- K   V
+ s   S
+ v   //local/K
+ k   V
 ', '//');
 
 is_output($svk, 'up', [$copath],
 	  ['Syncing //^viewA at 31(/prj/trunk) in '.__($corpath).' to 35.']);
 
-append_file("$copath/V/be", "local\n");
+append_file("$copath/v/be", "local\n");
 
-append_file("$copath/S/be", "mirrored\n");
+append_file("$copath/s/be", "mirrored\n");
 #$svk->diff($copath);
 
 is_output($svk, 'ci', [-m => 'booo', $copath],
 	  ["Can't commit a view with changes in multiple mirror sources."]);
 
-is_output($svk, 'ci', [-m => 'booo', "$copath/S/be"],
+is_output($svk, 'ci', [-m => 'booo', "$copath/s/be"],
 	  ['Commit into mirrored path: merging back directly.',
 	   "Merging back to mirror source $uri/project.",
 	   'Merge back committed as revision 31.',
@@ -150,20 +149,25 @@
 	  ]);
 
 is_output($svk, 'st', [$copath],
-	  [__("M   $copath/V/be")]);
+	  [__("M   $copath/v/be")]);
 
 TODO: {
 local $TODO = 'fix _commit_callback wrapper';
 is_output($svk, 'ci', [-m => 'should be on local', $copath],
 	  ['Committed revision 37.']);
 }
-is_output($svk, 'st', [$copath], []);
 
-__END__
+is_output($svk, 'st', [$copath], []);
 
-append_file("$copath/K/be", "mirrored as well\n");
+is_output($svk, 'mv', ["$copath/v/be", "$copath/v/be2"],
+	  [__("A   $copath/v/be2"),
+	   __("D   $copath/v/be")]);
+TODO: {
+local $TODO = 'checkout after mv is broken';
+is_output($svk, 'st', [$copath],
+	  [__("A + $copath/v/be2"),
+	   __("D   $copath/v/be")]);
 
-append_file("$copath/S/be", "mirrored\n");
+is_output($svk, 'ci', [$copath], ['Committed revision 38.']);
 
-warn "===> mixed?";
-$svk->ci(-m => 'booo', $copath);
+}


More information about the svk-commit mailing list