[PATCH V2] context: override workingctx.hex() to avoid a crash

Yuya Nishihara yuya at tcha.org
Wed Jun 17 18:01:03 CDT 2015


On Wed, 17 Jun 2015 11:39:45 -0700, Pierre-Yves David wrote:
> On 06/15/2015 07:33 PM, Matt Harbison wrote:
> > # HG changeset patch
> > # User Matt Harbison <matt_harbison at yahoo.com>
> > # Date 1434333857 14400
> > #      Sun Jun 14 22:04:17 2015 -0400
> > # Node ID e8aad4e14a74b6034d48183d737d52e78ba4c6b4
> > # Parent  a69983942fb4dbfdf5ca8c7a123120ed09ead5db
> > context: override workingctx.hex() to avoid a crash
> >
> > Since node is None for workingctx, it can't use the base class implementation of
> > 'hex(self.node())'.
> >
> > It doesn't appear that there are any current callers of this, but there will be
> > when archive supports 'wdir()'.  My first thought was to use "{p1node}+", but
> > that would cause headaches elsewhere [1].
> >
> > We should probably fix up localrepository.__getitem__ to accept this hash for
> > consistency, as a followup.  This works, if the full hash is specified:
> >
> >    @@ -480,7 +480,7 @@
> >             return dirstate.dirstate(self.vfs, self.ui, self.root, validate)
> >
> >         def __getitem__(self, changeid):
> >    -        if changeid is None:
> >    +        if changeid is None or changeid == 'ff' * 20:
> 
> Look's like we need a mercurial.node.wdirid
> (and mercurial.node.wdirrev)

I'm thinking of it. I'll try them in revset experiment.


More information about the Mercurial-devel mailing list