Mercurial > hg
comparison hgext/rebase.py @ 37377:3dfd7f018c69
rebase: convert "oldrev" to revnum earlier
It was done in 3 places before, now just 1.
Differential Revision: https://phab.mercurial-scm.org/D3139
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 05 Apr 2018 10:13:45 -0700 |
parents | 25940470c7e6 |
children | 953db9e00eeb |
comparison
equal
deleted
inserted
replaced
37376:25940470c7e6 | 37377:3dfd7f018c69 |
---|---|
241 # compatibility check that the line doesn't look like the | 241 # compatibility check that the line doesn't look like the |
242 # oldrev:newrev lines | 242 # oldrev:newrev lines |
243 activebookmark = l | 243 activebookmark = l |
244 else: | 244 else: |
245 args = l.split(':') | 245 args = l.split(':') |
246 oldrev = args[0] | 246 oldrev = repo[args[0]].rev() |
247 newrev = args[1] | 247 newrev = args[1] |
248 if newrev in legacystates: | 248 if newrev in legacystates: |
249 continue | 249 continue |
250 if len(args) > 2: | 250 if len(args) > 2: |
251 destrev = repo[args[2]].rev() | 251 destrev = repo[args[2]].rev() |
252 else: | 252 else: |
253 destrev = legacydest | 253 destrev = legacydest |
254 destmap[repo[oldrev].rev()] = destrev | 254 destmap[oldrev] = destrev |
255 if newrev in (nullid, revtodostr): | 255 if newrev in (nullid, revtodostr): |
256 state[repo[oldrev].rev()] = revtodo | 256 state[oldrev] = revtodo |
257 # Legacy compat special case | 257 # Legacy compat special case |
258 else: | 258 else: |
259 state[repo[oldrev].rev()] = repo[newrev].rev() | 259 state[oldrev] = repo[newrev].rev() |
260 | 260 |
261 except IOError as err: | 261 except IOError as err: |
262 if err.errno != errno.ENOENT: | 262 if err.errno != errno.ENOENT: |
263 raise | 263 raise |
264 cmdutil.wrongtooltocontinue(repo, _('rebase')) | 264 cmdutil.wrongtooltocontinue(repo, _('rebase')) |