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

login
register
mail settings
Submitter phabricator
Date April 5, 2019, 6:34 p.m.
Message ID <differential-rev-PHID-DREV-o5lkpql76ix7raolubo7-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39510/
State Superseded
Headers show

Comments

phabricator - April 5, 2019, 6:34 p.m.
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




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - April 5, 2019, 6:35 p.m.
martinvonz added a comment.


  I created this stack on the default branch, but it's probably small enough to be put on stable.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - April 5, 2019, 7:18 p.m.
martinvonz added inline comments.

INLINE COMMENTS

> test-convert-hg-source.t:213-215
> +Create a commit we'll drop while converting so we get different hashes
> +  $ echo a > unwanted
> +  $ hg ci -Aqm 'unwanted'

I just remembered that there is a `convert.hg.sourcename` that can be used for this purpose. I'll update the stack in a few minutes

REPOSITORY
  rHG Mercurial

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

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

Patch

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