# HG changeset patch # User Durham Goode # Date 2014-05-08 23:33:06 # Node ID 4aeb7a6029bafb4847bb27604a97d70ea1ee0fde # Parent 4adc090fa2fb2d4e0094630a5440852d20cbd7ea merge: prevent simplemerge from mutating label list simplemerge was using list.pop() to remove items from the labels list. This mutated the list and made it unusable by other calls (for instance, it might be used in both the premerge and actual merge stages). diff --git a/mercurial/simplemerge.py b/mercurial/simplemerge.py --- a/mercurial/simplemerge.py +++ b/mercurial/simplemerge.py @@ -416,11 +416,11 @@ def simplemerge(ui, local, base, other, name_a = local name_b = other labels = opts.get('label', []) - if labels: - name_a = labels.pop(0) - if labels: - name_b = labels.pop(0) - if labels: + if len(labels) > 0: + name_a = labels[0] + if len(labels) > 1: + name_b = labels[1] + if len(labels) > 2: raise util.Abort(_("can only specify two labels.")) try: