path: root/contrib/fast-import
diff options
authorPete Wyckoff <>2011-12-25 02:07:39 (GMT)
committerJunio C Hamano <>2011-12-27 18:19:31 (GMT)
commit09fca77b9ecd64e2008835208bab29e15a4b2809 (patch)
treeb4a7e2c95118b4d39b562ba18592d43c2bb6a5ce /contrib/fast-import
parentae3f41f20a0b5a9fa3e83a12557c887855b920f3 (diff)
git-p4: test and document --use-client-spec
The depot path is required, even with this option. Make sure git-p4 fails and exits with non-zero. Contents in the specified depot path will be rearranged according to the client spec. Test this and add a note in the docs. Leave an XXX suggesting that this is somewhat confusing behavior that might be good to fix later. Function stripRepoPath() looks at self.useClientSpec. Make sure this is set both for command-line option --use-client-spec and for configuration variable git-p4.useClientSpec. Test this. Signed-off-by: Pete Wyckoff <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'contrib/fast-import')
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index d0a9b0d..5420bf1 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1951,7 +1951,10 @@ class P4Sync(Command, P4UserMap):
if not gitBranchExists(self.refPrefix + "HEAD") and self.importIntoRemotes and gitBranchExists(self.branch):
system("git symbolic-ref %sHEAD %s" % (self.refPrefix, self.branch))
- if self.useClientSpec or gitConfig("git-p4.useclientspec") == "true":
+ if not self.useClientSpec:
+ if gitConfig("git-p4.useclientspec", "--bool") == "true":
+ self.useClientSpec = True
+ if self.useClientSpec:
# TODO: should always look at previous commits,
@@ -2380,6 +2383,7 @@ def main():
if not
+ sys.exit(2)
if __name__ == '__main__':