Mercurial > hg
changeset 21636:3de9f2c4900c
convert: only consider shamap revisions converted if they still exists
Rollback or strip could leave a Mercurial repo with a shamap with revisions no
longer in the repository.
To ensure reliable conversions we now check that the commit actually exists and
consider it non-existing if it doesn't exist.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 19 May 2014 22:12:31 +0200 |
parents | 5f2cc464e502 |
children | 48ef68004ec9 |
files | hgext/convert/convcmd.py tests/test-convert-hg-sink.t |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/convert/convcmd.py Mon May 19 22:12:30 2014 +0200 +++ b/hgext/convert/convcmd.py Mon May 19 22:12:31 2014 +0200 @@ -173,8 +173,12 @@ parents = {} while visit: n = visit.pop(0) - if n in known or n in self.map: + if n in known: continue + if n in self.map: + m = self.map[n] + if m == SKIPREV or self.dest.hascommitfrommap(m): + continue known.add(n) self.ui.progress(_('scanning'), len(known), unit=_('revisions')) commit = self.cachecommit(n)
--- a/tests/test-convert-hg-sink.t Mon May 19 22:12:30 2014 +0200 +++ b/tests/test-convert-hg-sink.t Mon May 19 22:12:31 2014 +0200 @@ -526,8 +526,11 @@ scanning source... sorting... converting... + 0 extra f+a-only change $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n' + o 3 extra f+a-only change (f) + | o 2 x (f) | @ 1 a (f)