summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64ffb06)
raw | patch | inline | side by side (parent: 64ffb06)
author | Simon Hausmann <simon@lst.de> | |
Sun, 20 May 2007 14:33:21 +0000 (16:33 +0200) | ||
committer | Simon Hausmann <simon@lst.de> | |
Sun, 20 May 2007 14:33:21 +0000 (16:33 +0200) |
applying them to a Perforce checkout. This should make it possible to apply git
commits with binary files that cannot be handled by path.
Signed-off-by: Simon Hausmann <simon@lst.de>
commits with binary files that cannot be handled by path.
Signed-off-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/git-p4 | patch | blob | history |
index 80d966fb305de9eccec58cb1dd1187e6751db382..0b1df09cb87ca8ce901218602d0ee0785b347053 100755 (executable)
else:
die("unknown modifier %s for %s" % (modifier, path))
- diffcmd = "git diff-tree -p --diff-filter=ACMRTUXB \"%s^\" \"%s\"" % (id, id)
- patchcmd = diffcmd + " | patch -p1"
+ diffcmd = "git format-patch -k --stdout \"%s^\"..\"%s\"" % (id, id)
+ patchcmd = diffcmd + " | git apply "
+ tryPatchCmd = diffcmd + "--check -"
+ applyPatchCmd = diffcmd + "--check --apply -"
+ print mypopen(diffcmd).read()
- if os.system(patchcmd + " --dry-run --silent") != 0:
+ if os.system(tryPatchCmd) != 0:
print "Unfortunately applying the change failed!"
print "What do you want to do?"
response = "x"
print "Skipping! Good luck with the next patches..."
return
elif response == "a":
- os.system(patchcmd)
+ os.system(applyPatchCmd)
if len(filesToAdd) > 0:
print "You may also want to call p4 add on the following files:"
print " ".join(filesToAdd)
print "Patch saved to patch.txt in %s !" % self.clientPath
die("Please resolve and submit the conflict manually and continue afterwards with git-p4 submit --continue")
- system(patchcmd)
+ system(applyPatchCmd)
for f in filesToAdd:
system("p4 add %s" % f)