diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-01-27 10:45:41 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-01-27 10:45:41 -0800 |
commit | 523f0a25b91c34ec817bc5757f52f365f497e3bb (patch) | |
tree | 09d5b98d64030b0e7f97c2e5536b466adcfa4c32 /git-p4.py | |
parent | 33d4669aaa658f3e35f88748ed2db51c84203f62 (diff) | |
parent | f84cb684634f50df7adde7f52c25f049d257f0e3 (diff) | |
download | git-523f0a25b91c34ec817bc5757f52f365f497e3bb.tar.gz git-523f0a25b91c34ec817bc5757f52f365f497e3bb.tar.xz |
Merge branch 'pw/git-p4'
Various "git p4" updates.
* pw/git-p4:
git p4 doc: use two-line style for options with multiple spellings
git p4 test: examine behavior with locked (+l) files
git p4: fix an error message when "p4 where" fails
git p4: handle files with wildcards when doing RCS scrubbing
git p4 test: do not pollute /tmp
git p4 test: run as user "author"
git p4 test: is_cli_file_writeable succeeds
git p4 test: explicitly check p4 wildcard delete
git p4: work around p4 bug that causes empty symlinks
git p4 test: ensure p4 symlink parsing works
git p4 test: wildcards are supported
Diffstat (limited to 'git-p4.py')
-rwxr-xr-x | git-p4.py | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -310,8 +310,8 @@ def split_p4_type(p4type): # # return the raw p4 type of a file (text, text+ko, etc) # -def p4_type(file): - results = p4CmdList(["fstat", "-T", "headType", file]) +def p4_type(f): + results = p4CmdList(["fstat", "-T", "headType", wildcard_encode(f)]) return results[0]['headType'] # @@ -1220,7 +1220,7 @@ class P4Submit(Command, P4UserMap): editor = os.environ.get("P4EDITOR") else: editor = read_pipe("git var GIT_EDITOR").strip() - system(editor + " " + template_file) + system([editor, template_file]) # If the file was not saved, prompt to see if this patch should # be skipped. But skip this verification step if configured so. @@ -1871,7 +1871,7 @@ class View(object): # assume error is "... file(s) not in client view" continue if "clientFile" not in res: - die("No clientFile from 'p4 where %s'" % depot_path) + die("No clientFile in 'p4 where' output") if "unmap" in res: # it will list all of them, but only one not unmap-ped continue @@ -2075,7 +2075,14 @@ class P4Sync(Command, P4UserMap): # p4 print on a symlink sometimes contains "target\n"; # if it does, remove the newline data = ''.join(contents) - if data[-1] == '\n': + if not data: + # Some version of p4 allowed creating a symlink that pointed + # to nothing. This causes p4 errors when checking out such + # a change, and errors here too. Work around it by ignoring + # the bad symlink; hopefully a future change fixes it. + print "\nIgnoring empty symlink in %s" % file['depotFile'] + return + elif data[-1] == '\n': contents = [data[:-1]] else: contents = [data] |