changeset hash changed with upgrade causing tags to be hidden
Created originally on Bitbucket by Reece Hart
I've used hg-git for years with [https://github.com/biocommons/hgvs/](https://github.com/biocommons/hgvs). After a recent upgrade to ubuntu 19.04, and therefore to hg 4.8.2, with hg-git tip (5d688b5cc153), I'm seeing some disturbing behavior.
The first symptom was this:
$ hg tags
abort: 00changelog.i@f2ee08e6e70d: no node!
I recloned the repo and noticed that it was missing tags. The github repo has 107 tags. hg tags
reports only 81. After debugging hg tags
, I discovered that localrepo.py:tags()
silently filters out tags that point to non-existent nodes. All of my tags were lost there.
A superficial view of hg log
made it look like all changesets were accounted for. However, a more careful inspection showed that *some* changeset hashes had changed. Fortunately, I have the old repo still, so I can compare. For example, here's a recent set of changes on the old (`hgvs`) and newly-cloned (`hgvs-2`) repos:
snafu$ hg -R hgvs log -l 20 --template="{date|shortdate} {node|short} {rev} {desc|firstline}\n" --date "2019-04-01 to 2019-04-10"
2019-04-06 c48ff9a809d8 1445 Fix typo in docs (#554)
2019-04-05 21f5292fe0c5 1444 expose seqrepo reference in SeqFetcher instance
2019-04-05 b5e1eec13e3a 1443 remove relative path in pkg_resources.resource_filename() to eliminate warning about future failure
2019-04-04 96aa97278043 1442 Closes #544: Update installation docs
snafu$ hg -R hgvs-2 log -l 20 --template="{date|shortdate} {node|short} {rev} {desc|firstline}\n" --date "2019-04-01 to 2019-04-10"
2019-04-06 60dac045a371 1445 Fix typo in docs (#554)
2019-04-05 478f1efb6195 1444 expose seqrepo reference in SeqFetcher instance
2019-04-05 b9c1bd5d906f 1443 remove relative path in pkg_resources.resource_filename() to eliminate warning about future failure
2019-04-04 fb88f580ac3a 1442 Closes #544: Update installation docs
However, the changesets match earlier in the history:
snafu$ hg -R hgvs log -l 20 --template="{date|shortdate} {node|short} {rev} {desc|firstline}\n" --date "2016-04-01 to 2016-05-14"
2016-04-01 6170b5f2ff91 926 merged 0.4.5 into default
2016-04-01 2976ea3c4870 827 Added tag 0.4.5 for changeset c3ab00acccdd
2016-04-01 3bd244430fe5 826 update documentation + last minute change in length_change signature
snafu$ hg -R hgvs-2 log -l 20 --template="{date|shortdate} {node|short} {rev} {desc|firstline}\n" --date "2016-04-01 to 2016-05-14"
2016-04-01 6170b5f2ff91 926 merged 0.4.5 into default
2016-04-01 2976ea3c4870 827 Added tag 0.4.5 for changeset c3ab00acccdd
2016-04-01 3bd244430fe5 826 update documentation + last minute change in length_change signature
That seems like a problem in many contexts, but especially for tags in .hgtags that are associated with an older hash. For example:
snafu$ fgrep 1.2.5 hgvs/.hgtags
093bf68e2c1da73b49c1eb9ef0c98d09735daf7f 1.2.5
snafu$ hg -R hgvs log -r 093bf68e2c
changeset: 1422:093bf68e2c1d
tag: 1.2.5
user: Reece Hart <reecehart@gmail.com>
date: Fri Feb 01 12:12:52 2019 -0800
summary: Added changelog for 1.2.5
snafu$ hg -R hgvs-2 log -r 093bf68e2c
abort: unknown revision '093bf68e2c'!
I thought this might be attributable to a particular version of hg-git
. So, I checked out all of the versions that work on 4.8.2, then recloned the source repo and counted tags. This bug (I think?) appears before the changes that enable 4.8.2. I haven't tried backporting those changes.
Finally, I looked at backups and ascertained that my hg-git
was c651bb6fcf33 (0.8.12) until Oct 2018, then 6ae26ba7b928 until last week. So, the above hgvs was cloned with one of those.