Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[vcv] r48: allow to --init files only if size chang...

Committer: ailyin
allow to --init files only if size changes
U   trunk/bin/vcv
Modified: trunk/bin/vcv
===================================================================
--- trunk/bin/vcv	2010-03-12 05:37:43 UTC (rev 47)
+++ trunk/bin/vcv	2010-03-26 06:10:28 UTC (rev 48)
@@ -4,6 +4,8 @@
 use strict;
 use Getopt::Long;
 
+Getopt::Long::Configure("bundling");
+
 $| = 1;
 
 my $help = 0;
@@ -12,6 +14,7 @@
 my $cvsonly = 0;
 my $liveonly = 0;
 my $init = 0;
+my $require_size_change = 0;
 my $conf;
 my $opt_update;
 my $opt_justfiles;
@@ -34,11 +37,12 @@
 exit 1 unless GetOptions('conf=s' => \$conf,
                          'help|h' => \$help,
                          's|sync' => \$sync,
-                         'diff' => \$diff,
+                         'diff|d' => \$diff,
                          'cvsonly|c' => \$cvsonly,
                          'liveonly|l' => \$liveonly,
-                         'init' => \$init,
-                         'update' => \$opt_update,
+                         'init|i' => \$init,
+                         'require-size-change|rsc' => \$require_size_change,
+                         'update|u' => \$opt_update,
                          'justfiles|1' => \$opt_justfiles,
                          'print-branches|pb' => \$opt_print_branches,
                          'print-current-branches|pcb' => \$opt_print_current_branches,
@@ -49,7 +53,7 @@
                          'all' => \$opt_all,  # cancels --these
                          'livelist|ll' => \$opt_livelist,
                          'checkout|co' => \$opt_checkout,
-                         'which' => \$opt_which,
+                         'which|w' => \$opt_which,
                          'map'   => \$opt_map,
                          'headserver|hs=s' => \$opt_headserver,
                          'svk=s'   => \$opt_svk,
@@ -68,6 +72,7 @@
         "    --cvsonly       Don't consider files changed in live dirs.\n".
         "    --liveonly      Don't consider files changed in the CVS dirs.\n".
         "    --init          Copy all files from cvs to main, unconditionally.\n" .
+        "    --require-size-change --rsc    with --init, do not replace files with the same sizes\n" .
         "    --update        Updates files in the CVS dirs from the cvs repositories.\n".
         "    --justfiles -1  Only output files, not the old -> new arrow. (good for xargs)\n".
         "    --livelist -ll  Output the list of all accounted-for files.\n".
@@ -384,6 +389,10 @@
     }
 
     if ($init) {
+        if ($require_size_change) {
+            next if (-s $lfile) == (-s $cfile);
+        }
+
         $status = "main <- $root";
         ($from, $to) = ($cfile, $lfile);
     } else {

Tags: andy, vcv
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments