Compare commits

...

2 Commits
v1.3 ... v1.3.2

Author SHA1 Message Date
8c6eef4713 Make repo's editor work when the editor is a commandline with
multiple args.
2008-11-14 21:12:44 -05:00
34d237fbfb Paper bag fix repo 1.3's "repo upload" without --replace
If we aren't doing a replacement we do not have any
replace rules, so we cannot iterate over them.

Signed-off-by: Shawn O. Pearce <sop@google.com>
2008-11-12 18:37:18 -08:00
2 changed files with 7 additions and 6 deletions

View File

@ -69,14 +69,14 @@ least one of these before using this command."""
Returns: Returns:
new value of edited text; None if editing did not succeed new value of edited text; None if editing did not succeed
""" """
editor = cls._GetEditor() editor = cls._GetEditor().split()
fd, path = tempfile.mkstemp() fd, path = tempfile.mkstemp()
try: try:
os.write(fd, data) os.write(fd, data)
os.close(fd) os.close(fd)
fd = None fd = None
if subprocess.Popen([editor, path]).wait() != 0: if subprocess.Popen(editor + [path]).wait() != 0:
raise EditorError() raise EditorError()
return open(path).read() return open(path).read()
finally: finally:

View File

@ -114,10 +114,11 @@ def UploadBundle(project,
req.dest_branch = str(dest_branch) req.dest_branch = str(dest_branch)
for c in revlist: for c in revlist:
req.contained_object.append(c) req.contained_object.append(c)
for change_id,commit_id in replace_changes.iteritems(): if replace_changes:
r = req.replace.add() for change_id,commit_id in replace_changes.iteritems():
r.change_id = change_id r = req.replace.add()
r.object_id = commit_id r.change_id = change_id
r.object_id = commit_id
else: else:
req = UploadBundleContinue() req = UploadBundleContinue()
req.bundle_id = bundle_id req.bundle_id = bundle_id