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

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


On Fri, Mar 12, 2010 at 06:35:13AM +0800, Tay Ray Chuan wrote:
> Hi,
> 
> On Fri, Mar 12, 2010 at 12:39 AM, Benoit Boissinot
> <benoit.boissinot at ens-lyon.org> wrote:
> > But it would be probably easier if you explained your high level goal,
> > we could see what's the best way to do it.
> 
> In hg-git, mappings of hg to git objects via their SHA-1 are recorded.
> However, I find myself rewriting history pretty frequently (eg.
> through mq's strip), and some of these mappings get stale (ie. a
> mapping entry with a SHA-1 pointing to a non-existent hg object).
> 
> What I want is to detect which mappings have gone stale.
> 
> I've thought about two ways to this:
> 
> 1. Hook on to mq's strip, so that each time the command is invoked, we
> detect which revs get removed/bundled and remove those mappings from
> the map file.
> 
>   However, I don't see any extensible callback to this easily.
> 
> 2. Invoke some mercurial API method to detect which SHA-1 points to
> non-existent hg objects.

Just record the first changsets which introduce the filenode (like
linkrev, except more precise, you need to record every branch). Then you
just need to check if any of the changesets in question are there.

Would that work?

Benoit

-- 
:wq


More information about the Mercurial-devel mailing list