Mercurial > evolve
comparison hgext/evolution.py @ 91:5b8d08c78854
[evolution:relocate] propertly interpred src and destination.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Tue, 20 Sep 2011 18:15:48 +0200 |
parents | 64fe5a4f877e |
children | 5b23cdf998d0 |
comparison
equal
deleted
inserted
replaced
90:a5f6194eb05c | 91:5b8d08c78854 |
---|---|
160 '') | 160 '') |
161 def cmdrelocate(ui, repo, dest, rev='.'): | 161 def cmdrelocate(ui, repo, dest, rev='.'): |
162 """relocate a changeset""" | 162 """relocate a changeset""" |
163 wlock = repo.wlock() | 163 wlock = repo.wlock() |
164 try: | 164 try: |
165 src = repo[rev] | 165 src = scmutil.revsingle(repo, rev, rev) |
166 dest = repo[dest] | 166 dest = scmutil.revsingle(repo, dest, dest) |
167 if src == src.ancestor(dest): | 167 if src == src.ancestor(dest): |
168 raise util.Abort(_('source is ancestor of destination')) | 168 raise util.Abort(_('source is ancestor of destination')) |
169 relocate(repo, src.rev(), dest.rev()) | 169 relocate(repo, src.rev(), dest.rev()) |
170 return 0 | 170 return 0 |
171 finally: | 171 finally: |