comparison mercurial/cmdutil.py @ 23101:b564330d4b1f stable

amend: abort early if no username is configured with evolve enabled (issue4211) Amend will reuse the original username if a new one is not provided with -U, but obsolete.createmarkers() only considers ui.username() for the obsolete marker's metadata. Allowing the metadata field to be spoofed seems to defeat the point of the field in the first place. This covers 'evolve amend' and 'ci --amend' with evolve enabled. Without this, the transaction aborts but the parent changeset is set to -1. The corresponding test will be added to evolve separately.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 28 Oct 2014 23:05:19 -0400
parents 6c86c673dde6
children e53f6b72a0e4 edf29f9c15f0
comparison
equal deleted inserted replaced
23100:ac494b087feb 23101:b564330d4b1f
2119 2119
2120 return commitfunc(ui, repo, message, 2120 return commitfunc(ui, repo, message,
2121 scmutil.match(repo[None], pats, opts), opts) 2121 scmutil.match(repo[None], pats, opts), opts)
2122 2122
2123 def amend(ui, repo, commitfunc, old, extra, pats, opts): 2123 def amend(ui, repo, commitfunc, old, extra, pats, opts):
2124 # amend will reuse the existing user if not specified, but the obsolete
2125 # marker creation requires that the current user's name is specified.
2126 if obsolete._enabled:
2127 ui.username() # raise exception if username not set
2128
2124 ui.note(_('amending changeset %s\n') % old) 2129 ui.note(_('amending changeset %s\n') % old)
2125 base = old.p1() 2130 base = old.p1()
2126 2131
2127 wlock = lock = newid = None 2132 wlock = lock = newid = None
2128 try: 2133 try: