comparison hgext/evolve.py @ 1351:69e5de3e6129

evolve: small refactoring of the uncommit function We introduce a new variable to simplify the implementation of hg uncommit --interactive.
author Laurent Charignon <lcharignon@fb.com>
date Wed, 27 May 2015 10:23:37 -0700
parents d46a967f257e
children b4a62d6f0353
comparison
equal deleted inserted replaced
1350:d46a967f257e 1351:69e5de3e6129
2129 raise util.Abort(_("cannot uncommit to parent changeset")) 2129 raise util.Abort(_("cannot uncommit to parent changeset"))
2130 2130
2131 # Recommit the filtered changeset 2131 # Recommit the filtered changeset
2132 tr = repo.transaction('uncommit') 2132 tr = repo.transaction('uncommit')
2133 newid = None 2133 newid = None
2134 if (pats or opts.get('include') or opts.get('exclude') 2134 includeorexclude = opts.get('include') or opts.get('exclude')
2135 or opts.get('all')): 2135 if (pats or includeorexclude or opts.get('all')):
2136 match = scmutil.match(old, pats, opts) 2136 match = scmutil.match(old, pats, opts)
2137 newid = _commitfiltered(repo, old, match, target=rev) 2137 newid = _commitfiltered(repo, old, match, target=rev)
2138 if newid is None: 2138 if newid is None:
2139 raise util.Abort(_('nothing to uncommit'), 2139 raise util.Abort(_('nothing to uncommit'),
2140 hint=_("use --all to uncommit all files")) 2140 hint=_("use --all to uncommit all files"))