Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /svnutils/trunk/src/

svnutils
Discussion topic

Back to topic list

CVS update: /svnutils/trunk/src/

Author sunny256
Full name Øyvind A. Holm
Date 2005-02-08 10:13:58 PST
Message User: sunny256
Date: 05/02/08 10:13:58

Modified:
 /svnutils/trunk/src/
  svndiff

Log:
 r98 | sunny256 | 2005-02-08 18:05:13 +0000 (Tue, 08 Feb 2005) | 4 lines
 
 * /trunk/src/svndiff
   After diffing conflicted files, the user is asked if the conflict is
   fixed. By answering "y", the conflict is marked as resolved by svn.

File Changes:

Directory: /svnutils/trunk/src/
===============================

File [changed]: svndiff
Url: http://svnutils.tigr​is.org/source/browse​/svnutils/trunk/src/​svndiff?r1=1.9&r​2=1.10
Delta lines: +23 -7
--------------------
--- svndiff 8 Feb 2005 18:12:23 -0000 1.9
+++ svndiff 8 Feb 2005 18:13:58 -0000 1.10
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 #===================​====================​====================​============
-# $Id: svndiff 97 2005-02-08 18:01:20Z sunny256 $
+# $Id: svndiff 98 2005-02-08 18:05:13Z sunny256 $
 # Uses a specified diff program for viewing differences in a Subversion
 # versioned directory tree.
 #
@@ -53,17 +53,23 @@
     }
 } else {
     if (open(PipeFP, "$CMD_SVN stat -q |")) {
+ my %has_conflict = ();
         while (<PipeFP>) {
             chomp();
             D("<PipeFP> = \"$_\"\n");
- if (/^[$stat_chars]......(.*)/) {
- push(@mod_array, $1);
+ if (/^([$stat_chars])......(.*)/) {
+ my ($Stat, $File) =
+ ( $1, $2);
+ D("\$Stat = \"$Stat\", \$File = \"$File\"\n");
+ push(@mod_array, $File);
+ $has_conflict{$File} = ($Stat =~ /$ST_CONFLICT/) ? 1 : 0;
+ D("\$has_conflict{$File} = \"$has_conflict{$File}\"\n");
             }
         }
         close(PipeFP);
         for (sort @mod_array) {
             my $File = $_;
- diff_file($File);
+ diff_file($File, $has_conflict{$File});
         }
     } else {
         warn("$progname: Error opening \"$CMD_SVN stat -q\" pipe");
@@ -71,7 +77,7 @@
 }
 
 sub diff_file {
- my $File1 = shift;
+ my ($File1, $has_conflict) = @_;
     my $Path = "";
     my $File = $File1;
 
@@ -99,6 +105,16 @@
         system("$Cmd $File2 $File1");
     }
 
+ if ($has_conflict) {
+ print("$progname: Write y and press ENTER if the conflict " .
+ "in $File1 is resolved: ");
+ if (<STDIN> =~ /^y$/i) {
+ print("$progname: OK, marking $File1 as resolved.\n");
+ D("CMD: $CMD_SVN resolved $File1");
+ system("$CMD_SVN resolved $File1");
+ }
+ }
+
     # Sleep one second after $Cmd is done to make it easier to interrupt
     # the thing with CTRL-C if there are many files
     sleep(1) if (scalar(@mod_array) > 1);
@@ -148,7 +164,7 @@
 
 =head1 REVISION
 
-$Id: svndiff 97 2005-02-08 18:01:20Z sunny256 $
+$Id: svndiff 98 2005-02-08 18:05:13Z sunny256 $
 
 =head1 SYNOPSIS
 
@@ -221,4 +237,4 @@
 # }}}
 
 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :
-# End of file $Id: svndiff 97 2005-02-08 18:01:20Z sunny256 $
+# End of file $Id: svndiff 98 2005-02-08 18:05:13Z sunny256 $




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@svnu​tils.tigris.org
For additional commands, e-mail: cvs-help at svnutils dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /svnutils/trunk/src/ sunny256 Øyvind A. Holm 2005-02-08 10:13:58 PST
Messages per page: