##// END OF EJS Templates
convert: update the transplant, rebase and graft references in 'extra'...
Matt Harbison -
r21765:44255f7c default
parent child Browse files
Show More
@@ -165,6 +165,24 b' class mercurial_sink(converter_sink):'
165 text = text.replace(sha1, newrev[:len(sha1)])
165 text = text.replace(sha1, newrev[:len(sha1)])
166
166
167 extra = commit.extra.copy()
167 extra = commit.extra.copy()
168
169 for label in ('source', 'transplant_source', 'rebase_source'):
170 node = extra.get(label)
171
172 if node is None:
173 continue
174
175 # Only transplant stores its reference in binary
176 if label == 'transplant_source':
177 node = hex(node)
178
179 newrev = revmap.get(node)
180 if newrev is not None:
181 if label == 'transplant_source':
182 newrev = bin(newrev)
183
184 extra[label] = newrev
185
168 if self.branchnames and commit.branch:
186 if self.branchnames and commit.branch:
169 extra['branch'] = commit.branch
187 extra['branch'] = commit.branch
170 if commit.rev:
188 if commit.rev:
@@ -461,6 +461,37 b' Now transplant a graft to test following'
461 date: Thu Jan 01 00:00:00 1970 +0000
461 date: Thu Jan 01 00:00:00 1970 +0000
462 summary: 2
462 summary: 2
463
463
464 Test that the graft and transplant markers in extra are converted, allowing
465 origin() to still work. Note that these recheck the immediately preceeding two
466 tests.
467 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
468
469 The graft case
470 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
471 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
472 branch=default
473 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
474 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
475 $ hg -R ../converted log -r 'origin(7)'
476 changeset: 2:e0213322b2c1
477 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: 2
480
481 The transplant case
482 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
483 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
484 branch=dev
485 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
486 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac (esc)
487 `h\x9b (esc)
488 $ hg -R ../converted log -r 'origin(tip)'
489 changeset: 2:e0213322b2c1
490 user: test
491 date: Thu Jan 01 00:00:00 1970 +0000
492 summary: 2
493
494
464 Test simple destination
495 Test simple destination
465 $ hg log -r 'destination()'
496 $ hg log -r 'destination()'
466 changeset: 7:ef0ef43d49e7
497 changeset: 7:ef0ef43d49e7
General Comments 0
You need to be logged in to leave comments. Login now