Mercurial > hg
comparison hgext/rebase.py @ 23246:643c58303fb0 stable 3.2.1
rebase: fix rebase with no common ancestors (issue4446)
The new rebase revset didn't check for the case when there are no common
ancestors. Now it does. The new behavior should be the same as the pre-3.2
behavior. Added a test.
author | Durham Goode <durham@fb.com> |
---|---|
date | Mon, 10 Nov 2014 10:44:42 -0800 |
parents | d583f1cfca96 |
children | 3480c07fc934 57d35d3c1cf1 |
comparison
equal
deleted
inserted
replaced
23245:d33a90cb2a32 | 23246:643c58303fb0 |
---|---|
272 if not base: | 272 if not base: |
273 ui.status(_('empty "base" revision set - ' | 273 ui.status(_('empty "base" revision set - ' |
274 "can't compute rebase set\n")) | 274 "can't compute rebase set\n")) |
275 return 1 | 275 return 1 |
276 commonanc = repo.revs('ancestor(%ld, %d)', base, dest).first() | 276 commonanc = repo.revs('ancestor(%ld, %d)', base, dest).first() |
277 rebaseset = repo.revs('(%d::(%ld) - %d)::', | 277 if commonanc is not None: |
278 commonanc, base, commonanc) | 278 rebaseset = repo.revs('(%d::(%ld) - %d)::', |
279 commonanc, base, commonanc) | |
280 else: | |
281 rebaseset = [] | |
282 | |
279 if not rebaseset: | 283 if not rebaseset: |
280 # transform to list because smartsets are not comparable to | 284 # transform to list because smartsets are not comparable to |
281 # lists. This should be improved to honor lazyness of | 285 # lists. This should be improved to honor lazyness of |
282 # smartset. | 286 # smartset. |
283 if list(base) == [dest.rev()]: | 287 if list(base) == [dest.rev()]: |