From: "Patrick C. McGinty" <casey.mcginty@gmail.com>
To: casey.mcginty@gmail.com, git@vger.kernel.org
Subject: [PATCH] git-p4: Strip branch name prefixes if --use-client-spec enabled
Date: Mon, 20 Aug 2012 13:43:30 -1000 [thread overview]
Message-ID: <1345506210-17382-1-git-send-email-casey.mcginty@gmail.com> (raw)
From: "Patrick C. McGinty" <casey.mcginty@gmail.com>
This removes the branch names from being included in the file system
path when using the both --use-client-spec and --detect-branches
options.
Used alone, the --detect-branches option did the right thing, removing
the branch names from the relative git path. By adding the
--use-client-spec option, the old logic would incorrectly bypass this
step.
Signed-off-by: Patrick C. McGinty <casey.mcginty@gmail.com>
---
git-p4.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index e67d37d..9489845 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1819,7 +1819,15 @@ class P4Sync(Command, P4UserMap):
def stripRepoPath(self, path, prefixes):
if self.useClientSpec:
- return self.clientSpecDirs.map_in_client(path)
+ # map path to user defined client location
+ path = self.clientSpecDirs.map_in_client(path)
+ # Remove prefixes (e.g. branch names) from path. Apply the
+ # clientSpecDirs map to the prefix paths to match the
+ # modified path value.
+ for p in map(self.clientSpecDirs.map_in_client, prefixes):
+ if p and p4PathStartsWith( path, p):
+ path = path[len(p):]
+ return path
if self.keepRepoPath:
prefixes = [re.sub("^(//[^/]+/).*", r'\1', prefixes[0])]
--
1.7.9.5
next reply other threads:[~2012-08-21 0:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-20 23:43 Patrick C. McGinty [this message]
2012-08-22 21:22 ` [PATCH] git-p4: Strip branch name prefixes if --use-client-spec enabled Pete Wyckoff
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=1345506210-17382-1-git-send-email-casey.mcginty@gmail.com \
--to=casey.mcginty@gmail.com \
--cc=git@vger.kernel.org \
/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).