Subject: [PATCH 2/2] archimport: sync_to_ps() messages for tracking tla methods

From: Eric Wong <[email-masked]>
Date: Tue, 15 Nov 2005 00:06:52 -0800

This patch adds debug messages (enabled with the usual -v switch) for
tracking how often each tla command is called.

Signed-off-by: Eric Wong <[email-masked]>

---

 git-archimport.perl |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

applies-to: 8a7cc429d0fd935805851ac5ac10941d0bd86e94
b4de7920e0116afb35016435131a404658818ced
diff --git a/git-archimport.perl b/git-archimport.perl
index b624ba6..1f721f6 100755
--- a/git-archimport.perl
+++ b/git-archimport.perl
@@ -429,18 +429,23 @@ sub sync_to_ps {
     my $ps = shift;
     my $tree_dir = $tmptree.'/'.tree_dirname($ps->{id});
 
+    $opt_v && print "sync_to_ps($ps->{id}) method: ";
+
     if (-d $tree_dir) {
         if ($ps->{type} eq 't') {
             # looks like a tag-only or (worse,) a mixed tags/changeset branch,
             # can't rely on replay to work correctly on these
             rmtree($tree_dir);
+	    $opt_v && print "get (tag)\n";
             safe_pipe_capture($TLA,'get','--no-pristine',$ps->{id},$tree_dir);
         } else {
                 my $tree_id = arch_tree_id($tree_dir);
                 if ($ps->{parent_id} eq $tree_id) {
                     # the common case (hopefully)
+		    $opt_v && print "replay\n";
                     safe_pipe_capture($TLA,'replay','-d',$tree_dir,$ps->{id});
                 } else {
+		    $opt_v && print "apply-delta\n";
                     # this can happen if branches cherry-pick
                     safe_pipe_capture($TLA,'apply-delta','-d',$tree_dir,
                                                         $tree_id, $ps->{id});
@@ -448,6 +453,7 @@ sub sync_to_ps {
         }
     } else {
         # new branch work
+        $opt_v && print "get (new tree)\n";
         safe_pipe_capture($TLA,'get','--no-pristine',$ps->{id},$tree_dir);
     }
    
---
0.99.9.GIT