fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-07-13 01:41 pm

[vcv] updating to stable releases

[commit: http://hg.dwscoalition.org/vcv/rev/832259689aa4]

http://bugs.dwscoalition.org/show_bug.cgi?id=3755

This defines a --stable option for the vcv script (only used in conjunction
with --update), and adds revision support to the sections of the code that
parse Mercurial repository information from multicvs.conf. It will not
honor the "stable" revision unless the --stable option is given.

Patch by [personal profile] kareila.

Files modified:
  • bin/vcv
--------------------------------------------------------------------------------
diff -r f901e5f8eb84 -r 832259689aa4 bin/vcv
--- a/bin/vcv	Tue Mar 29 10:32:49 2011 +0800
+++ b/bin/vcv	Wed Jul 13 21:40:33 2011 +0800
@@ -16,6 +16,7 @@
 my $init = 0;
 my $conf;
 my $opt_update;
+my $opt_stable;
 my $opt_justfiles;
 my $opt_checkout;
 my $opt_print_branches;
@@ -55,6 +56,7 @@
                          'map'   => \$opt_map,
                          'headserver|hs=s' => \$opt_headserver,
                          'svk=s'   => \$opt_svk,
+                         'stable'  => \$opt_stable,
                          );
 
 
@@ -70,6 +72,7 @@
         "    --newonly       Only show files that seem to be new.\n".
         "    --init          Copy all files from cvs to main, unconditionally.\n" .
         "    --update        Updates files in the CVS dirs from the cvs repositories.\n".
+        "    --stable        Restrict --update to the most recent stable DW release.\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".
         "    --which         Output the source of the given file\n".
@@ -185,6 +188,11 @@
             die "HG declaration without CVSDIR declared\n" unless $DIR_CVS;
             my ($ldir, $src, $rev) = ($1, $2, $3);
 
+            # stable check
+            if ( defined $rev && $rev eq 'stable' ) {
+                undef $rev unless $opt_stable;
+            }
+
             my @urlparts = split(/\//, $src);
             my $url = join("/", @urlparts[0..$#urlparts-1]);
             $REPO_URLS{$ldir} = $url;
@@ -326,8 +334,10 @@
                 system("cvs", "-q", "update", "-dP")
                     and die "Failed to update cvs for: $dir\n";
             } elsif (-d ".hg" ) {
+                my @opts;
+                push @opts, "-r", $REPO_REV{$root} if $REPO_REV{$root};
                 system("hg", "pull");
-                system("hg", "update");
+                system("hg", "update", @opts);
             } elsif (-d ".git" ) {
                 system("git", "pull");
             }elsif ($SVK) {
--------------------------------------------------------------------------------