summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c2d28c)
raw | patch | inline | side by side (parent: 9c2d28c)
author | David Brown <git@davidb.org> | |
Wed, 19 Sep 2007 20:12:48 +0000 (13:12 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 22 Sep 2007 22:41:50 +0000 (15:41 -0700) |
git-p4 was missing the execute bit setting if the file had other attribute
bits set.
Acked-By: Simon Hausmann <simon@lst.de>
bits set.
Acked-By: Simon Hausmann <simon@lst.de>
contrib/fast-import/git-p4 | patch | blob | history |
index 55778c577564dc2afde8cf36f3dbc1c994e4ded4..65c57ac4d8247ec279e4f018d36ef93dcca78061 100755 (executable)
if os.system(cmd) != 0:
die("command failed: %s" % cmd)
+def isP4Exec(kind):
+ """Determine if a Perforce 'kind' should have execute permission
+
+ 'p4 help filetypes' gives a list of the types. If it starts with 'x',
+ or x follows one of a few letters. Otherwise, if there is an 'x' after
+ a plus sign, it is also executable"""
+ return (re.search(r"(^[cku]?x)|\+.*x", kind) != None)
+
def p4CmdList(cmd, stdin=None, stdin_mode='w+b'):
cmd = "p4 -G %s" % cmd
if verbose:
data = file['data']
mode = "644"
- if file["type"].startswith("x"):
+ if isP4Exec(file["type"]):
mode = "755"
elif file["type"] == "symlink":
mode = "120000"