Subject: [PATCH 3/5] git-p4 stream: show relative path in debug messages

From: Pete Wyckoff <[email-masked]>
Date: Sat, 25 Jul 2009 10:24:34 -0400

Not repo path, but the one where git will put the file.  They're
shorter and allows verifying branchPrefixes too.

Signed-off-by: Pete Wyckoff <[email-masked]>
---
 contrib/fast-import/git-p4 |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 3a52254..3ab016b 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -954,10 +954,9 @@ class P4Sync(Command):
     # - helper for streamP4Files
 
     def streamOneP4File(self, file, contents):
-        if verbose:
-            sys.stderr.write("%s\n" %  file["depotFile"])
-
         relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes)
+        if verbose:
+            sys.stderr.write("%s\n" % relPath)
 
         mode = "644"
         if isP4Exec(file["type"]):
@@ -994,11 +993,9 @@ class P4Sync(Command):
         self.gitStream.write("\n")
 
     def streamOneP4Deletion(self, file):
-        if verbose:
-            sys.stderr.write("delete %s\n" %  file["path"])
-
         relPath = self.stripRepoPath(file['path'], self.branchPrefixes)
-
+        if verbose:
+            sys.stderr.write("delete %s\n" % relPath)
         self.gitStream.write("D %s\n" % relPath)
 
     # Stream directly from "p4 files" into "git fast-import"
-- 
1.6.2.5