From 34d237fbfbd87e8bb81063c23737e9b1ee4d5679 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 12 Nov 2008 18:37:18 -0800 Subject: [PATCH] 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 --- gerrit_upload.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gerrit_upload.py b/gerrit_upload.py index 32451408..d3d4ff3e 100755 --- a/gerrit_upload.py +++ b/gerrit_upload.py @@ -114,10 +114,11 @@ def UploadBundle(project, req.dest_branch = str(dest_branch) for c in revlist: req.contained_object.append(c) - for change_id,commit_id in replace_changes.iteritems(): - r = req.replace.add() - r.change_id = change_id - r.object_id = commit_id + if replace_changes: + for change_id,commit_id in replace_changes.iteritems(): + r = req.replace.add() + r.change_id = change_id + r.object_id = commit_id else: req = UploadBundleContinue() req.bundle_id = bundle_id