[PATCH STABLE] convert: don't drop missing or corrupt tag entries

Yuya Nishihara yuya at tcha.org
Wed Aug 15 00:32:06 EDT 2018


On Tue, 14 Aug 2018 22:09:03 -0400, Matt Harbison wrote:
> On Tue, 14 Aug 2018 19:21:05 -0400, Yuya Nishihara <yuya at tcha.org> wrote:
> > Doesn't it leave tags on skipped revisions?
> 
> Prior to this patch, not exactly.  I verified this is still a problem:

Ok, I agree that this patch doesn't make things worse. Queued for stable,
thanks.

> https://bz.mercurial-scm.org/show_bug.cgi?id=5737#c2
> 
> Prior to trying that test, I tried this change, and it seems to drop the  
> tag entry entirely without the patch proposed in this thread.

That seems correct (except it results in an empty commit.)

> If this is
> changed to `hg tag --rev 2`, it keeps the tag, but moves it to the  
> parent(!) (So I guess dropping it with --rev 0 is because there is no  
> p1(0)?)

Perhaps. A skipped revision is mapped to its parent at converter.copy().

> > I understand this sort of feature is needed, but there would be no point  
> > to keep invalid/unknown tags if we aren't trying to preserve hashes.
> 
> Mostly agree.  But I think preserving the hashes by default is desirable,  
> and what
> at least part of the code is trying to do.  For 5737, it should probably
> keep the original hash unchanged, and warn (which the proposed patch  
> does).  I'd be fine with a config knob that defaults to preserve.

Suppose the purpose of hg->hg conversion is to rewrite a part of history,
I don't think hash preservation is the most important thing. That said,
it should be fine to keep originally invalid tags as invalid.


More information about the Mercurial-devel mailing list