summaryrefslogtreecommitdiff
path: root/contrib/fast-import
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-24 00:13:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-09-24 00:13:55 (GMT)
commit4f337e24662f07513fd6e8388f27f13dbe44cadc (patch)
tree8ad206ef3ff7aa7117a5c9120bbd45345ff7ae3a /contrib/fast-import
parent17ed158021ead9cb056f692fc35ff3fcde96a747 (diff)
parent15eda0202aa3c63fa7b8f9f72df86f4e50eb1d2b (diff)
downloadgit-4f337e24662f07513fd6e8388f27f13dbe44cadc.zip
git-4f337e24662f07513fd6e8388f27f13dbe44cadc.tar.gz
git-4f337e24662f07513fd6e8388f27f13dbe44cadc.tar.bz2
Merge branch 'maint'
* maint: git-svn: don't attempt to spawn pager if we don't want one Supplant the "while case ... break ;; esac" idiom User Manual: add a chapter for submodules user-manual: don't assume refs are stored under .git/refs Detect exec bit in more cases. Conjugate "search" correctly in the git-prune-packed man page. Move the paragraph specifying where the .idx and .pack files should be Documentation/git-lost-found.txt: drop unnecessarily duplicated name.
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-xcontrib/fast-import/git-p410
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index adaaae6..557649a 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -63,6 +63,14 @@ def system(cmd):
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:
@@ -932,7 +940,7 @@ class P4Sync(Command):
data = file['data']
mode = "644"
- if file["type"].startswith("x"):
+ if isP4Exec(file["type"]):
mode = "755"
elif file["type"] == "symlink":
mode = "120000"