Login | Register
My pages Projects Community openCollabNet

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

svnutils
Discussion topic

Back to topic list

CVS update: /svnutils/trunk/src/svndiff

Author sunny256
Full name Øyvind A. Holm
Date 2007-04-07 06:14:41 PDT
Message User: sunny256
Date: 2007-04-07 06:14:41-0700
Log:
 r204 | sunny256 | 2007-04-05 14:41:55 +0000 (Thu, 05 Apr 2007) | 13
 lines
 
 * /trunk/src/svndiff
   Deprecate some command line options and rename them to make them more
   svn(1) compatible. Things have changed over the years since 2004, most
   notably the new svn -c option.
 
     --diffcmd (-c) changed to --diff-cmd
     --svncmd (-e) changed to --svn-cmd (-e)
     --diffargs (-p) changed to --extensions (-x)
 
   If any of the old versions are used, a warning will occur. This will
   go on for some weeks or so to let people update their scripts and
   habits. After this period, they will be deleted.

File Changes:

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

File [changed]: svndiff
Url: http://svnutils.tigr​is.org/source/browse​/svnutils/trunk/src/​svndiff?r1=1.37&​r2=1.38
Delta lines: +44 -19
---------------------
--- svndiff 2007-04-07 06:13:31-0700 1.37
+++ svndiff 2007-04-07 06:14:39-0700 1.38
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 #===================​====================​====================​============
-# $Id: svndiff 202 2007-04-05 03:53:39Z sunny256 $
+# $Id: svndiff 204 2007-04-05 14:41:55Z sunny256 $
 # Uses a specified diff program for viewing differences in a Subversion
 # versioned directory tree.
 #
@@ -23,11 +23,14 @@
     'conflict' => 0,
     'create-rc' => 0,
     'debug' => 0,
- 'diffargs' => "",
- 'diffcmd' => "",
+ 'diff-cmd' => "",
+ 'diffargs' => "", # DEPRECATED
+ 'diffcmd' => "", # DEPRECATED
+ 'extensions' => "",
     'help' => 0,
     'revision' => "",
- 'svncmd' => "",
+ 'svn-cmd' => "",
+ 'svncmd' => "", # DEPRECATED
     'verbose' => 0,
     'version' => 0,
 );
@@ -35,7 +38,7 @@
 our $progname = $0;
 $progname =~ s#^.*/(.*?)$#$1#;
 
-my $rcs_id = '$Id: svndiff 202 2007-04-05 03:53:39Z sunny256 $';
+my $rcs_id = '$Id: svndiff 204 2007-04-05 14:41:55Z sunny256 $';
 my $id_date = $rcs_id;
 $id_date =~ s/^.*?\d+ (\d\d\d\d-.*?\d​\d:\d\d:\d\d\S​+).*/$1/;
 
@@ -44,15 +47,37 @@
     "conflict|C" => \$Opt{'conflict'},
     "create-rc" => \$Opt{'create-rc'},
     "debug" => \$Opt{'debug'},
- "diffargs|p=s" => \$Opt{'diffargs'},
- "diffcmd|c=s" => \$Opt{'diffcmd'},
+ "diff-cmd=s" => \$Opt{'diff-cmd'},
+ "diffargs|p=s" => \$Opt{'diffargs'}, # DEPRECATED
+ "diffcmd|c=s" => \$Opt{'diffcmd'}, # DEPRECATED
+ "extensions|x=s" => \$Opt{'extensions'},
     "help|h" => \$Opt{'help'},
     "revision|r=s" => \$Opt{'revision'},
- "svncmd|e=s" => \$Opt{'svncmd'},
+ "svn-cmd|e=s" => \$Opt{'svn-cmd'},
+ "svncmd=s" => \$Opt{'svncmd'}, # DEPRECATED
     "verbose|v+" => \$Opt{'verbose'},
     "version" => \$Opt{'version'},
 ) || die("$progname: Option error. Use -h for help.\n");
 
+deprecated("diffargs", "extensions", "--diffargs (-p)", "--extensions (-x)");
+deprecated("diffcmd", "diff-cmd", "--diffcmd (-c)", "--diff-cmd");
+deprecated("svncmd", "svn-cmd", "--svncmd", "--svn-cmd (-e)");
+
+sub deprecated {
+ # Temporary subroutine until the old versions of the options are
+ # removed.
+ # {{{
+ my ($old_name, $new_name, $Old, $New) = @_;
+
+ if (length($Opt{$old_name})) {
+ warn("$progname: WARNING: The use of the $Old option " .
+ "is deprecated, use $New instead\n");
+ $Opt{$new_name} = $Opt{$old_name};
+ $Opt{$old_name} = undef;
+ }
+ # }}}
+} # deprecated()
+
 $Opt{'debug'} && ($Debug = 1);
 $Opt{'version'} && print_version();
 
@@ -115,9 +140,9 @@
     exit(0);
 }
 
-length($Opt{'diffcmd'}) && ($Cmd = $Opt{'diffcmd'});
-length($Opt{'diffargs'}) && ($Cmd .= " $Opt{'diffargs'}");
-length($Opt{'svncmd'}) && ($CMD_SVN = $Opt{'svncmd'});
+length($Opt{'diff-cmd'}) && ($Cmd = $Opt{'diff-cmd'});
+length($Opt{'extensions'}) && ($Cmd .= " $Opt{'extensions'}");
+length($Opt{'svn-cmd'}) && ($CMD_SVN = $Opt{'svn-cmd'});
 
 my $stat_chars = "$ST_CONFLICT$ST_MODIFIED";
 $Opt{'conflict'} && ($stat_chars = "$ST_CONFLICT");
@@ -489,13 +514,13 @@
     Send a configuration file example to stdout. To create a new
     ~/.svndiffrc file, write
       $progname --create-rc >~/.svndiffrc
- -c, --diffcmd x
+ --diff-cmd x
     Use x as the diff command. Default: "$Cmd".
- -e, --svncmd x
+ -e, --svn-cmd x
     Use x as the svn executable. Default: "$CMD_SVN".
   -h, --help
     Show this help.
- -p, --diffargs x
+ -x, --extensions x
     Use x as parameters to the diff program.
   -r, --revision x
     Run a $Cmd command against previous revisions:
@@ -553,7 +578,7 @@
 
 =head1 REVISION
 
-$Id: svndiff 202 2007-04-05 03:53:39Z sunny256 $
+$Id: svndiff 204 2007-04-05 14:41:55Z sunny256 $
 
 =head1 SYNOPSIS
 
@@ -582,19 +607,19 @@
 
   $progname --create-rc >~/.svndiffrc
 
-=item B<-c>, B<--diffcmd> x
+=item B<--diff-cmd> x
 
 Use x as the diff command.
 Default: "svndiff".
 
-=item B<-e>, B<--svncmd> x
+=item B<-e>, B<--svn-cmd> x
 
 Use x as the svn executable.
 Example:
 
   svndiff -e /usr/local/bin/svn-1.0
 
-=item B<-p>, B<--diffargs> x
+=item B<-x>, B<--extensions> x
 
 Use x as parameters to the diff program.
 
@@ -744,4 +769,4 @@
 # }}}
 
 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=0 et fo+=w :
-# End of file $Id: svndiff 202 2007-04-05 03:53:39Z sunny256 $
+# End of file $Id: svndiff 204 2007-04-05 14:41:55Z sunny256 $

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

Messages

Show all messages in topic

CVS update: /svnutils/trunk/src/svndiff sunny256 Øyvind A. Holm 2007-04-07 06:14:41 PDT
Messages per page: