r3867 - branches/nexuiz-2.0

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Jul 21 10:34:16 EDT 2008


Author: div0
Date: 2008-07-21 10:34:16 -0400 (Mon, 21 Jul 2008)
New Revision: 3867

Modified:
   branches/nexuiz-2.0/branch-manager
Log:
--force feature


Modified: branches/nexuiz-2.0/branch-manager
===================================================================
--- branches/nexuiz-2.0/branch-manager	2008-07-21 14:25:16 UTC (rev 3866)
+++ branches/nexuiz-2.0/branch-manager	2008-07-21 14:34:16 UTC (rev 3867)
@@ -250,8 +250,8 @@
 }
 elsif($cmd eq 'merge')
 {
-	my ($first, $last) = @args;
-	die "Usage: $0 merge first last"
+	my ($first, $last, $force) = @args;
+	die "Usage: $0 merge first last [--force]"
 		if not defined $first;
 	$last = $first if not defined $last;
 
@@ -259,7 +259,7 @@
 		if "$first$last" =~ /[^0-9]/;
 
 	die "There is an uncommitted merge"
-		if -f '.commitmsg';
+		if -f '.commitmsg' and $force ne '--force';
 
 	LoadSettings();
 	AddPatch $first, $last;
@@ -269,7 +269,7 @@
 	print "Make sure there are no conflicts, then run $0 commit\n";
 	print "To abort, use $0 revert\n";
 	
-	open my $fh, '>', '.commitmsg'
+	open my $fh, '>>', '.commitmsg'
 		or die "open .commitmsg";
 	print $fh GetLog $first, $last;
 	close $fh;
@@ -278,7 +278,7 @@
 }
 elsif($cmd eq 'undo')
 {
-	my ($first, $last) = @args;
+	my ($first, $last, $force) = @args;
 	die "Usage: $0 undo first last"
 		if not defined $first;
 	$last = $first if not defined $last;
@@ -286,9 +286,8 @@
 	die "Usage: $0 merge first last"
 		if "$first$last" =~ /[^0-9]/;
 
-	
 	die "There is an uncommitted merge"
-		if -f '.commitmsg';
+		if -f '.commitmsg' and $force ne '--force';
 
 	LoadSettings();
 	RemovePatch $first, $last;
@@ -297,7 +296,7 @@
 	print "Make sure there are no conflicts, then run $0 commit\n";
 	print "To abort, use $0 revert\n";
 
-	open my $fh, '>', '.commitmsg'
+	open my $fh, '>>', '.commitmsg'
 		or die "open .commitmsg";
 	print $fh "undo the following merge:\n", GetLog $first, last;
 	close $fh;
@@ -336,8 +335,8 @@
   $0 info
   $0 unmerged
   $0 unmerged-diff
-  $0 merge rev1 [rev2]
-  $0 undo rev1 [rev2]
+  $0 merge rev1 [rev2] [--force]
+  $0 undo rev1 [rev2] [--force]
   $0 commit
   $0 revert
 EOF




More information about the nexuiz-commits mailing list