vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[vcv] r50: LJSUP-7809: script to decide rebuild rel...

Committer: vad
LJSUP-7809: script to decide rebuild release plan after commitbacks or not
U   trunk/bin/vcv
Modified: trunk/bin/vcv
===================================================================
--- trunk/bin/vcv	2010-03-30 07:52:40 UTC (rev 49)
+++ trunk/bin/vcv	2011-01-27 11:04:35 UTC (rev 50)
@@ -27,6 +27,7 @@
 my $these_flag;
 my $opt_livelist;
 my $opt_which;
+my $opt_where_live;
 my $opt_all;
 my $opt_map;
 my $opt_headserver;  # blank or "host:port", connect and returns lines of "repo\s+HEADREVNUM\n";
@@ -54,6 +55,7 @@
                          'livelist|ll' => \$opt_livelist,
                          'checkout|co' => \$opt_checkout,
                          'which|w' => \$opt_which,
+                         'where-live|wl' => \$opt_where_live,
                          'map'   => \$opt_map,
                          'headserver|hs=s' => \$opt_headserver,
                          'svk=s'   => \$opt_svk,
@@ -77,6 +79,7 @@
         "    --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".
+        "    --where-live    Output the live path of the given svn-ed file.\n".
         "    --these -t      Refuse to --sync if no files are specified.\n".
         "    --map           Like --livelist and --which combined.\n".
         "    --all           Overrides --these, allowing --sync to run with no args.\n".
@@ -244,6 +247,7 @@
 # paths and do any copying
 
 my %cvspath;  # live path -> cvs path
+my %livepath;  # cvs path  -> live path
 my %have_updated;
 
 foreach my $p (@paths)
@@ -345,6 +349,7 @@
                 $cvspath =~ s!//!/!g;
                 ## htdocs/js/dom.js --> js/dom.js
                 $cvspath{$livepath} = $cvspath;
+                $livepath{$cvspath} = $livepath;
             }
         }
         close MD;
@@ -364,6 +369,20 @@
 foreach my $relfile (@files)
 {
     my $status;
+
+    if ($opt_where_live and my $path = $livepath{$relfile}){
+    ## Output the live path of a given file from svn source dir
+        print $path, "\n";
+        next;
+    }
+
+    if ($opt_which and my $path = $cvspath{$relfile}){
+    ## Output the source of the given live file
+        print $path, "\n";
+        next;
+    }
+
+    ##
     next unless exists $cvspath{$relfile};
     my $root = $cvspath{$relfile};
     $root =~ s!/.*!!;
@@ -378,11 +397,6 @@
         next;
     }
 
-    if ($opt_which) {
-        print "$cvspath{$relfile}\n";
-        next;
-    }
-
     if ($opt_livelist) {
         print "$relfile\n";
         next;

Tags: vadvs, 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 

  • 2 comments