Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 21579:87a972b5c039
revert: use p2 as parent when reverting against it
revert was always using p1 as parent. This created some minor misbehavior when
reverting against p2. See test change for an example of that.
This is also a useful cleanup for coming refactoring to revert.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 14 May 2014 10:38:05 -0700 |
parents | 7cfe51661e98 |
children | 503bb3af70fe |
comparison
equal
deleted
inserted
replaced
21578:7cfe51661e98 | 21579:87a972b5c039 |
---|---|
2248 def revert(ui, repo, ctx, parents, *pats, **opts): | 2248 def revert(ui, repo, ctx, parents, *pats, **opts): |
2249 parent, p2 = parents | 2249 parent, p2 = parents |
2250 node = ctx.node() | 2250 node = ctx.node() |
2251 | 2251 |
2252 mf = ctx.manifest() | 2252 mf = ctx.manifest() |
2253 if node == p2: | |
2254 parent = p2 | |
2253 if node == parent: | 2255 if node == parent: |
2254 pmf = mf | 2256 pmf = mf |
2255 else: | 2257 else: |
2256 pmf = None | 2258 pmf = None |
2257 | 2259 |