D6212: tests: add test of for hash reference translation by `hg convert`

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Apr 5 14:34:13 EDT 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The convert extension translates commit references in the commit
  message. We didn't have any explicit testing of this before, so let's
  add a test.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6212

AFFECTED FILES
  tests/test-convert-hg-source.t

CHANGE DETAILS

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
@@ -206,3 +206,22 @@
   a
   c
   d
+  $ cd ..
+
+  $ hg init commit-references
+  $ cd commit-references
+Create a commit we'll drop while converting so we get different hashes
+  $ echo a > unwanted
+  $ hg ci -Aqm 'unwanted'
+  $ echo a > a
+  $ hg ci -Aqm initial
+  $ echo b > b
+  $ hg ci -Aqm 'the previous commit was 3ccbd4cbba95'
+
+  $ cd ..
+  $ hg convert commit-references new-commit-references -q \
+  >     --config convert.hg.startrev=1
+  $ cd new-commit-references
+  $ hg log -T '{node|short} {desc}\n'
+  38a97fe212e7 the previous commit was 3cf70f7c1f3b
+  3cf70f7c1f3b initial



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list