summaryrefslogtreecommitdiff
path: root/contrib/fast-import
diff options
context:
space:
mode:
authorLibravatar Simon Hausmann <simon@lst.de>2007-03-21 21:04:12 +0100
committerLibravatar Simon Hausmann <simon@lst.de>2007-03-21 21:04:12 +0100
commit53150250b13e7621c8ade1d59d19c946b745dd39 (patch)
treea5c3e39b6da7b8426b542245fece455a1522b9cb /contrib/fast-import
parentMake it possible to invoke git-p4 from within subdirectories of a git working... (diff)
downloadtgif-53150250b13e7621c8ade1d59d19c946b745dd39.tar.xz
Don't show the submit template and the diff first in less but show it in $editor right away
Signed-off-by: Simon Hausmann <simon@lst.de>
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-xcontrib/fast-import/git-p4.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/fast-import/git-p4.py b/contrib/fast-import/git-p4.py
index f940e93bad..06858844e5 100755
--- a/contrib/fast-import/git-p4.py
+++ b/contrib/fast-import/git-p4.py
@@ -235,24 +235,26 @@ class P4Sync(Command):
diff += "+" + line
f.close()
- pipe = os.popen("less", "w")
- pipe.write(submitTemplate + diff)
- pipe.close()
+ separatorLine = "######## everything below this line is just the diff #######\n"
response = "e"
+ firstIteration = True
while response == "e":
- response = raw_input("Do you want to submit this change (y/e/n)? ")
+ if not firstIteration:
+ response = raw_input("Do you want to submit this change (y/e/n)? ")
+ firstIteration = False
if response == "e":
[handle, fileName] = tempfile.mkstemp()
tmpFile = os.fdopen(handle, "w+")
- tmpFile.write(submitTemplate)
+ tmpFile.write(submitTemplate + separatorLine + diff)
tmpFile.close()
editor = os.environ.get("EDITOR", "vi")
system(editor + " " + fileName)
tmpFile = open(fileName, "r")
- submitTemplate = tmpFile.read()
+ message = tmpFile.read()
tmpFile.close()
os.remove(fileName)
+ submitTemplate = message[:message.index(separatorLine)]
if response == "y" or response == "yes":
if self.dryRun: