Mercurial > hg
comparison hgext/histedit.py @ 36404:6905c4ec312c
histedit: use ctx.rev() instead of %d % ctx
Weaning off basectx.__int__.
Differential Revision: https://phab.mercurial-scm.org/D2426
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 24 Feb 2018 10:53:47 -0800 |
parents | 10de411d7207 |
children | 72da480db4a5 |
comparison
equal
deleted
inserted
replaced
36403:10de411d7207 | 36404:6905c4ec312c |
---|---|
575 - date | 575 - date |
576 - username | 576 - username |
577 Commit message is edited in all cases. | 577 Commit message is edited in all cases. |
578 | 578 |
579 This function works in memory.""" | 579 This function works in memory.""" |
580 ctxs = list(repo.set('%d::%d', firstctx, lastctx)) | 580 ctxs = list(repo.set('%d::%d', firstctx.rev(), lastctx.rev())) |
581 if not ctxs: | 581 if not ctxs: |
582 return None | 582 return None |
583 for c in ctxs: | 583 for c in ctxs: |
584 if not c.mutable(): | 584 if not c.mutable(): |
585 raise error.ParseError( | 585 raise error.ParseError( |
728 repo.ui.warn(_('%s: empty changeset\n') % | 728 repo.ui.warn(_('%s: empty changeset\n') % |
729 node.short(self.node)) | 729 node.short(self.node)) |
730 return ctx, [(self.node, (parentctxnode,))] | 730 return ctx, [(self.node, (parentctxnode,))] |
731 | 731 |
732 parentctx = repo[parentctxnode] | 732 parentctx = repo[parentctxnode] |
733 newcommits = set(c.node() for c in repo.set('(%d::. - %d)', parentctx, | 733 newcommits = set(c.node() for c in repo.set('(%d::. - %d)', |
734 parentctx)) | 734 parentctx.rev(), |
735 parentctx.rev())) | |
735 if not newcommits: | 736 if not newcommits: |
736 repo.ui.warn(_('%s: cannot fold - working copy is not a ' | 737 repo.ui.warn(_('%s: cannot fold - working copy is not a ' |
737 'descendant of previous commit %s\n') % | 738 'descendant of previous commit %s\n') % |
738 (node.short(self.node), node.short(parentctxnode))) | 739 (node.short(self.node), node.short(parentctxnode))) |
739 return ctx, [(self.node, (ctx.node(),))] | 740 return ctx, [(self.node, (ctx.node(),))] |