checking for a non-existent node (change and file contexts)

Benoit Boissinot benoit.boissinot at ens-lyon.org
Thu Mar 11 10:39:23 CST 2010


On Fri, Mar 12, 2010 at 12:33:25AM +0800, Tay Ray Chuan wrote:
> Hi,
> 
> (I'm not subscribed to the list; please keep me Cc-ed.)
> 
> I am hacking a mercurial transport (hg-git to be exact) and I wish to
> know if there's an API method to check for the existence of an
> arbitrary SHA-1 node.

No, and it's quite expensive.

There are two ways:
Loop changelogs, record manifest hash, loop manifestdelta() (the truc
is to use *delta*, it's much less expensive), record files hash, done.

or

Loop store.datafiles(), load revlog index, record hashes (you /might/
find extra hashes though if there are orphaned revlogs)

But it would be probably easier if you explained your high level goal,
we could see what's the best way to do it.

Benoit
-- 
:wq


More information about the Mercurial-devel mailing list