From: Pete Wyckoff <pw@padd.com>
To: git@vger.kernel.org
Cc: Matthew Korich <matthew@korich.net>
Subject: [PATCH 4/5] git p4: do wildcard decoding in stripRepoPath
Date: Sat, 11 Aug 2012 12:55:03 -0400 [thread overview]
Message-ID: <1344704104-17727-4-git-send-email-pw@padd.com> (raw)
In-Reply-To: <20120811165143.GA2004@padd.com>
Instead of having to remember to do it after each call to
stripRepoPath, make it part of that function.
Signed-off-by: Pete Wyckoff <pw@padd.com>
---
git-p4.py | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/git-p4.py b/git-p4.py
index 6d07115..e20ff5d 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1819,15 +1819,17 @@ class P4Sync(Command, P4UserMap):
def stripRepoPath(self, path, prefixes):
if self.useClientSpec:
- return self.clientSpecDirs.map_in_client(path)
+ path = self.clientSpecDirs.map_in_client(path)
- if self.keepRepoPath:
- prefixes = [re.sub("^(//[^/]+/).*", r'\1', prefixes[0])]
+ else:
+ if self.keepRepoPath:
+ prefixes = [re.sub("^(//[^/]+/).*", r'\1', prefixes[0])]
- for p in prefixes:
- if p4PathStartsWith(path, p):
- path = path[len(p):]
+ for p in prefixes:
+ if p4PathStartsWith(path, p):
+ path = path[len(p):]
+ path = wildcard_decode(path)
return path
def splitFilesIntoBranches(self, commit):
@@ -1849,7 +1851,6 @@ class P4Sync(Command, P4UserMap):
fnum = fnum + 1
relPath = self.stripRepoPath(path, self.depotPaths)
- relPath = wildcard_decode(relPath)
for branch in self.knownBranches.keys():
@@ -1867,7 +1868,6 @@ class P4Sync(Command, P4UserMap):
def streamOneP4File(self, file, contents):
relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes)
- relPath = wildcard_decode(relPath)
if verbose:
sys.stderr.write("%s\n" % relPath)
@@ -1936,7 +1936,6 @@ class P4Sync(Command, P4UserMap):
def streamOneP4Deletion(self, file):
relPath = self.stripRepoPath(file['path'], self.branchPrefixes)
- relPath = wildcard_decode(relPath)
if verbose:
sys.stderr.write("delete %s\n" % relPath)
self.gitStream.write("D %s\n" % relPath)
--
1.7.12.rc2.24.gc304662
next prev parent reply other threads:[~2012-08-11 16:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-10 19:14 git-p4 migrates perforce “main” branch into git branches as subdirectories (doubled code in git branches) Matthew Korich
2012-08-11 16:51 ` [PATCH 0/5] git p4: fix branch detection with --use-client-spec Pete Wyckoff
2012-08-11 16:55 ` [PATCH 1/5] git p4 test: move client_view() function to library Pete Wyckoff
2012-08-11 16:55 ` [PATCH 2/5] git p4 test: add broken --use-client-spec --detect-branches tests Pete Wyckoff
2012-08-11 16:55 ` [PATCH 3/5] git p4: set self.branchPrefixes in initialization Pete Wyckoff
2012-08-11 16:55 ` Pete Wyckoff [this message]
2012-08-11 16:55 ` [PATCH 5/5] git p4: make branch detection work with --use-client-spec Pete Wyckoff
2012-08-12 4:41 ` [PATCH 0/5] git p4: fix branch detection " Junio C Hamano
2012-08-12 14:04 ` Pete Wyckoff
2012-08-12 19:30 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344704104-17727-4-git-send-email-pw@padd.com \
--to=pw@padd.com \
--cc=git@vger.kernel.org \
--cc=matthew@korich.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).