# HG changeset patch # User Pierre-Yves David # Date 1358547692 -3600 # Node ID c83d36b81df131640281c20e7100e6e8a33bc009 # Parent 4d92e2d75cffac5038b5b23c16f77cee8640dab2 rebase: lose the comparison to `nullmerge` For a proper behavior of the `--rev` revision we will need another possible state for revision ignored by rebase. We alter the comparison to `nullmerge` to match this future lower state too. diff -r 4d92e2d75cff -r c83d36b81df1 hgext/rebase.py --- a/hgext/rebase.py Fri Jan 18 23:43:32 2013 +0100 +++ b/hgext/rebase.py Fri Jan 18 23:21:32 2013 +0100 @@ -292,7 +292,7 @@ else: commitmsg = 'Collapsed revision' for rebased in state: - if rebased not in skipped and state[rebased] != nullmerge: + if rebased not in skipped and state[rebased] > nullmerge: commitmsg += '\n* %s' % repo[rebased].description() commitmsg = ui.edit(commitmsg, repo.ui.username()) newrev = concludenode(repo, rev, p1, external, commitmsg=commitmsg, @@ -305,7 +305,7 @@ # Nodeids are needed to reset bookmarks nstate = {} for k, v in state.iteritems(): - if v != nullmerge: + if v > nullmerge: nstate[repo[k].node()] = repo[v].node() if not keepf: @@ -479,7 +479,7 @@ marks = repo._bookmarks for k, v in originalbookmarks.iteritems(): if v in nstate: - if nstate[v] != nullmerge: + if nstate[v] > nullmerge: # update the bookmarks for revs that have moved marks[k] = nstate[v] @@ -497,7 +497,7 @@ f.write('%d\n' % int(keepbranches)) for d, v in state.iteritems(): oldrev = repo[d].hex() - if v != nullmerge: + if v > nullmerge: newrev = repo[v].hex() else: newrev = v @@ -679,7 +679,7 @@ if markers: obsolete.createmarkers(repo, markers) else: - rebased = [rev for rev in state if state[rev] != nullmerge] + rebased = [rev for rev in state if state[rev] > nullmerge] if rebased: stripped = [] for root in repo.set('roots(%ld)', rebased):