Skip to content

Commit

Permalink
git-p4: ensure submit clientPath exists before chdir
Browse files Browse the repository at this point in the history
Submitting patches back to p4 requires a p4 "client".  This
is a mapping from server depot paths into a local directory.
The directory need not exist or be populated with files; only
the mapping on the server is required.  When there is no
directory, make git-p4 automatically create it.

[ reword description --pw ]

Signed-off-by: Gary Gibbons <ggibbons@perforce.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Gary Gibbons authored and Junio C Hamano committed Dec 12, 2011
1 parent 9859a02 commit 0591cfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,10 @@ class P4Submit(Command, P4UserMap):
print "Perforce checkout for depot path %s located at %s" % (self.depotPath, self.clientPath)
self.oldWorkingDirectory = os.getcwd()

# ensure the clientPath exists
if not os.path.exists(self.clientPath):
os.makedirs(self.clientPath)

chdir(self.clientPath)
print "Synchronizing p4 checkout..."
p4_sync("...")
Expand Down

0 comments on commit 0591cfa

Please sign in to comment.