summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 81f2373)
raw | patch | inline | side by side (parent: 81f2373)
author | Simon Hausmann <shausman@trolltech.com> | |
Wed, 16 May 2007 07:41:26 +0000 (09:41 +0200) | ||
committer | Simon Hausmann <shausman@trolltech.com> | |
Wed, 16 May 2007 07:41:46 +0000 (09:41 +0200) |
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
contrib/fast-import/git-p4 | patch | blob | history |
index 84cdca1aa268902d7837fa4a7247287f91a878c2..eba7a67c68542b94447e981381c54b0f58840f31 100755 (executable)
diff = mypopen("git diff-tree -r --name-status \"%s^\" \"%s\"" % (id, id)).readlines()
filesToAdd = set()
filesToDelete = set()
+ editedFiles = set()
for line in diff:
modifier = line[0]
path = line[1:].strip()
if modifier == "M":
- system("p4 edit %s" % path)
+ system("p4 edit \"%s\"" % path)
+ editedFiles.add(path)
elif modifier == "A":
filesToAdd.add(path)
if path in filesToDelete:
firstIteration = True
while response == "e":
if not firstIteration:
- response = raw_input("Do you want to submit this change? [y]es/[e]dit/[n]o ")
+ response = raw_input("Do you want to submit this change? [y]es/[e]dit/[n]o/[s]kip ")
firstIteration = False
if response == "e":
[handle, fileName] = tempfile.mkstemp()
pipe = os.popen("p4 submit -i", "wb")
pipe.write(submitTemplate)
pipe.close()
+ elif response == "s":
+ for f in editedFiles:
+ system("p4 revert \"%s\"" % f);
+ for f in filesToAdd:
+ system("p4 revert \"%s\"" % f);
+ system("rm %s" %f)
+ for f in filesToDelete:
+ system("p4 delete \"%s\"" % f);
+ return
else:
print "Not submitting!"
self.interactive = False