##// END OF EJS Templates
convert: fix crash when existing converted revision didn't come from source...
Mads Kiilerich -
r19863:daeab82f default
parent child Browse files
Show More
@@ -7,7 +7,7 b''
7 7 import posixpath
8 8 import shlex
9 9 from mercurial.i18n import _
10 from mercurial import util
10 from mercurial import util, error
11 11 from common import SKIPREV, converter_source
12 12
13 13 def rpairs(name):
@@ -195,12 +195,19 b' class filemap_source(converter_source):'
195 195 self.seenchildren.clear()
196 196 for rev, wanted, arg in self.convertedorder:
197 197 if rev not in self.origparents:
198 self.origparents[rev] = self.getcommit(rev).parents
198 try:
199 self.origparents[rev] = self.getcommit(rev).parents
200 except error.RepoLookupError:
201 self.ui.debug("unknown revmap source: %s\n" % rev)
202 continue
199 203 if arg is not None:
200 204 self.children[arg] = self.children.get(arg, 0) + 1
201 205
202 206 for rev, wanted, arg in self.convertedorder:
203 parents = self.origparents[rev]
207 try:
208 parents = self.origparents[rev]
209 except KeyError:
210 continue # unknown revmap source
204 211 if wanted:
205 212 self.mark_wanted(rev, parents)
206 213 else:
@@ -410,6 +410,32 b' exercise incremental conversion at the s'
410 410 o 0 "addb" files: b
411 411
412 412
413 Test rebuilding of map with unknown revisions in shamap - it used to crash
414
415 $ cd branchpruning
416 $ hg up -r 2
417 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
418 $ hg merge 4
419 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
420 (branch merge, don't forget to commit)
421 $ hg ci -m 'merging something'
422 $ cd ..
423 $ echo "53792d18237d2b64971fa571936869156655338d 6d955580116e82c4b029bd30f321323bae71a7f0" >> branchpruning-hg2/.hg/shamap
424 $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2 --debug
425 run hg source pre-conversion action
426 run hg sink pre-conversion action
427 scanning source...
428 scanning: 1 revisions
429 sorting...
430 converting...
431 0 merging something
432 source: 2503605b178fe50e8fbbb0e77b97939540aa8c87
433 converting: 0/1 revisions (0.00%)
434 unknown revmap source: 53792d18237d2b64971fa571936869156655338d
435 run hg sink post-conversion action
436 run hg source post-conversion action
437
438
413 439 filemap rename undoing revision rename
414 440
415 441 $ hg init renameundo
General Comments 0
You need to be logged in to leave comments. Login now