# HG changeset patch # User Matt Mackall # Date 2015-05-27 19:28:29 # Node ID 884ef09cf658cf565c056ff75e675665fe520044 # Parent b1b89a0a606d74bfb48dfad239a352c55d3499b3 convert: properly pass null ids through .hgtags (issue4678) Mercurial uses tags of null to mark deletions, but convert was silently discarding these because it had no mapping for them. Thus, it was resurrecting deleted tags. diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py --- a/hgext/convert/hg.py +++ b/hgext/convert/hg.py @@ -128,7 +128,10 @@ class mercurial_sink(converter_sink): continue revid = revmap.get(source.lookuprev(s[0])) if not revid: - continue + if s[0] == hex(nullid): + revid = s[0] + else: + continue fp.write('%s %s\n' % (revid, s[1])) return fp.getvalue() diff --git a/tests/test-convert-hg-source.t b/tests/test-convert-hg-source.t --- a/tests/test-convert-hg-source.t +++ b/tests/test-convert-hg-source.t @@ -38,6 +38,13 @@ Test that template can print all file co (branch merge, don't forget to commit) $ hg ci -m 'merge remote copy' -d '4 0' created new head + +Make and delete some tags + + $ hg tag that + $ hg tag --remove that + $ hg tag this + #if execbit $ chmod +x baz #else @@ -50,11 +57,14 @@ Test that template can print all file co scanning source... sorting... converting... - 5 add foo bar - 4 change foo - 3 make bar and baz copies of foo - 2 merge local copy - 1 merge remote copy + 8 add foo bar + 7 change foo + 6 make bar and baz copies of foo + 5 merge local copy + 4 merge remote copy + 3 Added tag that for changeset 88586c4e9f02 + 2 Removed tag that + 1 Added tag this for changeset c56a7f387039 0 mark baz executable updating bookmarks $ cd new @@ -66,12 +76,12 @@ Test that template can print all file co #if execbit $ hg bookmarks premerge1 3:973ef48a98a4 - premerge2 5:13d9b87cf8f8 + premerge2 8:91d107c423ba #else Different hash because no x bit $ hg bookmarks premerge1 3:973ef48a98a4 - premerge2 5:df0779bcf33c + premerge2 8:3537b15eaaca #endif $ cd ..