vcssync: re-enable convert.git.saverev=false (
bug 1333616); r?glob
We successfully performed the 4.0 to 4.1 upgrade in the test
environment without any test fallout to vcssync. But this was
because we disabled convert.git.saverev=false.
In this commit, we re-enable that config option (which only works
on 4.1). As test-linearize-git-to-hg-source-annotations.t shows,
the "convert_revision" extra metadata disappeared (as the inline TODO
said it would). Hashes in other tests also changed because the
removal of this metadata changed the changeset content which changed
the hash. All other functionality remains unchanged.
MozReview-Commit-ID: HK4WWiqVHxR
--- a/vcssync/mozvcssync/git2hg.py
+++ b/vcssync/mozvcssync/git2hg.py
@@ -155,17 +155,17 @@ def linearize_git_repo_to_hg(git_source_
hg_config = [
b'extensions.convert=',
# Make the rename detection limit essentially infinite.
b'convert.git.renamelimit=1000000000',
# The ``convert_revision`` that would be stored reflects the rewritten
# Git commit. This is valuable as a persistent SHA map, but that's it.
# We (hopefully) insert the original Git commit via
# ``source_revision_key``, so this is of marginal value.
- #b'convert.git.saverev=false',
+ b'convert.git.saverev=false',
b'convert.git.similarity=%d' % similarity,
]
if find_copies_harder:
hg_config.append(b'convert.git.findcopiesharder=true')
if skip_submodules:
hg_config.append(b'convert.git.skipsubmodules=true')
--- a/vcssync/tests/test-linearize-git-to-hg-basic.t
+++ b/vcssync/tests/test-linearize-git-to-hg-basic.t
@@ -50,15 +50,15 @@ Basic git to hg linearize works
7 copy file0 to file0-copy1 and file0-copy2
6 move file0 to file0-moved
5 copy file0-moved and rename source
4 create file1-20, file1-50 and file1-80 as copies with mods
3 dummy commit 1 on master
2 dummy commit 2 on master
1 Merge branch 'head2'
0 dummy commit 1 after merge
- 11 Git commits converted to Mercurial; previous tip: -1:0000000000000000000000000000000000000000; current tip: 10:74b93af557b18fa56b0e9fad513ef9da1a1d950f
+ 11 Git commits converted to Mercurial; previous tip: -1:0000000000000000000000000000000000000000; current tip: 10:7d80acaa161029d9e746e3125e7cc0916406403f
Subsequent invocation no-ops
$ linearize-git-to-hg file://$TESTTMP/grepo master grepo-source grepo-dest
no new commits to linearize; not doing anything
all Git commits have already been converted; not doing anything
--- a/vcssync/tests/test-linearize-git-to-hg-copy-metadata.t
+++ b/vcssync/tests/test-linearize-git-to-hg-copy-metadata.t
@@ -36,60 +36,60 @@
7 copy file0 to file0-copy1 and file0-copy2
6 move file0 to file0-moved
5 copy file0-moved and rename source
4 create file1-20, file1-50 and file1-80 as copies with mods
3 dummy commit 1 on master
2 dummy commit 2 on master
1 Merge branch 'head2'
0 dummy commit 1 after merge
- 11 Git commits converted to Mercurial; previous tip: -1:0000000000000000000000000000000000000000; current tip: 10:74b93af557b18fa56b0e9fad513ef9da1a1d950f
+ 11 Git commits converted to Mercurial; previous tip: -1:0000000000000000000000000000000000000000; current tip: 10:7d80acaa161029d9e746e3125e7cc0916406403f
Move annotation should be preserved automatically
$ hg -R grepo-dest-default export 4
# HG changeset patch
# User test <test@example.com>
# Date 0 0
# Thu Jan 01 00:00:00 1970 +0000
- # Node ID 045473c2b7065422c50de2de883bbfabd42307e9
- # Parent 4670490276d96d9f5aafbcfba095b94401ce2f7b
+ # Node ID 87dc2703fa8274f2cbb4368fc5cd21dd6b891283
+ # Parent cf8b7b151d770811c9bdd22ecf9252ce497ac902
move file0 to file0-moved
diff --git a/file0 b/file0-moved
rename from file0
rename to file0-moved
Copy annotation should be preserved automatically
$ hg -R grepo-dest-default export 5
# HG changeset patch
# User test <test@example.com>
# Date 0 0
# Thu Jan 01 00:00:00 1970 +0000
- # Node ID 2f1c561c2bba03de041ae91b9bd996a8e1592a46
- # Parent 045473c2b7065422c50de2de883bbfabd42307e9
+ # Node ID 9448d0d725df65d963f7c9772f656c1777eff035
+ # Parent 87dc2703fa8274f2cbb4368fc5cd21dd6b891283
copy file0-moved and rename source
diff --git a/file0-moved b/file0-copied-with-move
rename from file0-moved
rename to file0-copied-with-move
diff --git a/file0-moved b/file0-moved-with-copy
copy from file0-moved
copy to file0-moved-with-copy
Normal copy won't be detected if source not modified
$ hg -R grepo-dest-default export 2
# HG changeset patch
# User test <test@example.com>
# Date 0 0
# Thu Jan 01 00:00:00 1970 +0000
- # Node ID ef5cf78e1c5224adea8f6cebba99ed88bed64389
- # Parent 9b56156dddc3d86f3afaba790ad91260c85c74b2
+ # Node ID 0645166c54cc387ec7b451618db945e6921a2f05
+ # Parent 39f28bdb42e2c48e9dff20d047ccba4d69bbf319
copy file0 to file0-copy0
diff --git a/file0-copy0 b/file0-copy0
new file mode 100644
--- /dev/null
+++ b/file0-copy0
@@ -0,0 +1,11 @@
+file0 0
@@ -108,33 +108,33 @@ Normal copy won't be detected if source
$ linearize-git-to-hg --find-copies-harder file://$TESTTMP/grepo master grepo-source grepo-dest-find-copy-harder > /dev/null 2>&1
$ hg -R grepo-dest-find-copy-harder export 2
# HG changeset patch
# User test <test@example.com>
# Date 0 0
# Thu Jan 01 00:00:00 1970 +0000
- # Node ID 69b9ae19ba84e5c77b119294715e992a8d7070bf
- # Parent 9b56156dddc3d86f3afaba790ad91260c85c74b2
+ # Node ID f793a24cb294215e734ba63f1741635927792532
+ # Parent 39f28bdb42e2c48e9dff20d047ccba4d69bbf319
copy file0 to file0-copy0
diff --git a/file0 b/file0-copy0
copy from file0
copy to file0-copy0
Copy detection similarity is sane
$ hg -R grepo-dest-find-copy-harder export 6
# HG changeset patch
# User test <test@example.com>
# Date 0 0
# Thu Jan 01 00:00:00 1970 +0000
- # Node ID b5b3e192ecdecbfc25d1ef6241664db3c63ef4d0
- # Parent c1afa6c62b584e017c1a3900055d2eba740092b5
+ # Node ID 5c6526a3256267aa3530fef4d51387ec90b61b20
+ # Parent f16834370a2a91f32d16d537de3590fd2f86c3fb
create file1-20, file1-50 and file1-80 as copies with mods
diff --git a/file1-20 b/file1-20
new file mode 100644
--- /dev/null
+++ b/file1-20
@@ -0,0 +1,2 @@
+file1 2
@@ -173,18 +173,18 @@ Increase similarity threshold removes co
$ linearize-git-to-hg --copy-similarity 70 --find-copies-harder file://$TESTTMP/grepo master grepo-source grepo-dest-similarity-70 > /dev/null 2>&1
$ hg -R grepo-dest-similarity-70 export 6
# HG changeset patch
# User test <test@example.com>
# Date 0 0
# Thu Jan 01 00:00:00 1970 +0000
- # Node ID 2cbb8f45b28f77c4b45382629a4b9fa297df0960
- # Parent c1afa6c62b584e017c1a3900055d2eba740092b5
+ # Node ID 65ca132d671b09006951d7b6f611cc6a7cc327c0
+ # Parent f16834370a2a91f32d16d537de3590fd2f86c3fb
create file1-20, file1-50 and file1-80 as copies with mods
diff --git a/file1-20 b/file1-20
new file mode 100644
--- /dev/null
+++ b/file1-20
@@ -0,0 +1,2 @@
+file1 2
--- a/vcssync/tests/test-linearize-git-to-hg-push-git.t
+++ b/vcssync/tests/test-linearize-git-to-hg-push-git.t
@@ -41,17 +41,17 @@
7 copy file0 to file0-copy1 and file0-copy2
6 move file0 to file0-moved
5 copy file0-moved and rename source
4 create file1-20, file1-50 and file1-80 as copies with mods
3 dummy commit 1 on master
2 dummy commit 2 on master
1 Merge branch 'head2'
0 dummy commit 1 after merge
- 11 Git commits converted to Mercurial; previous tip: -1:0000000000000000000000000000000000000000; current tip: 10:74b93af557b18fa56b0e9fad513ef9da1a1d950f
+ 11 Git commits converted to Mercurial; previous tip: -1:0000000000000000000000000000000000000000; current tip: 10:7d80acaa161029d9e746e3125e7cc0916406403f
All refs from local Git repo should be in mirror
$ git -C grepo-source for-each-ref
aea30981234cf6848489e0ccf541fbf902b27aca commit refs/convert/dest/heads/master
a447b9b0ff25bf17daab1c7edae4a998eca0adac commit refs/convert/source/heads/master
a447b9b0ff25bf17daab1c7edae4a998eca0adac commit refs/heads/master
@@ -82,17 +82,17 @@ Incremental conversion will keep Git rep
To file://$TESTTMP/grepo-mirror
aea3098..d6ec611 refs/convert/dest/heads/master -> refs/convert/dest/heads/master
a447b9b..4040c16 refs/convert/source/heads/master -> refs/convert/source/heads/master
converting 1 Git commits
scanning source...
sorting...
converting...
0 add incremental
- 1 Git commits converted to Mercurial; previous tip: 10:74b93af557b18fa56b0e9fad513ef9da1a1d950f; current tip: 11:b53d6fba975e3face586964aace142716b2191a7
+ 1 Git commits converted to Mercurial; previous tip: 10:7d80acaa161029d9e746e3125e7cc0916406403f; current tip: 11:bb82033b3f2dca56396a933e94a1ed802ae5cd26
$ git -C grepo-source for-each-ref
d6ec61184bff36a58159341c2584f3cda9dd0b58 commit refs/convert/dest/heads/master
4040c1631489c25dd4e0fd1606c4a065e1a24194 commit refs/convert/source/heads/master
4040c1631489c25dd4e0fd1606c4a065e1a24194 commit refs/heads/master
$ git -C grepo-mirror for-each-ref
d6ec61184bff36a58159341c2584f3cda9dd0b58 commit refs/convert/dest/heads/master
--- a/vcssync/tests/test-linearize-git-to-hg-push-hg.t
+++ b/vcssync/tests/test-linearize-git-to-hg-push-hg.t
@@ -35,17 +35,17 @@
7 copy file0 to file0-copy1 and file0-copy2
6 move file0 to file0-moved
5 copy file0-moved and rename source
4 create file1-20, file1-50 and file1-80 as copies with mods
3 dummy commit 1 on master
2 dummy commit 2 on master
1 Merge branch 'head2'
0 dummy commit 1 after merge
- 11 Git commits converted to Mercurial; previous tip: -1:0000000000000000000000000000000000000000; current tip: 10:74b93af557b18fa56b0e9fad513ef9da1a1d950f
+ 11 Git commits converted to Mercurial; previous tip: -1:0000000000000000000000000000000000000000; current tip: 10:7d80acaa161029d9e746e3125e7cc0916406403f
checking for outgoing changesets to file://$TESTTMP/hg-mirror
pushing to file://$TESTTMP/hg-mirror
searching for changes
adding changesets
adding manifests
adding file changes
added 11 changesets with 16 changes to 13 files
@@ -90,17 +90,17 @@ Incremental conversion should push new c
linearizing 1 commits from heads/master (4040c1631489c25dd4e0fd1606c4a065e1a24194 to 4040c1631489c25dd4e0fd1606c4a065e1a24194)
1/1 4040c1631489c25dd4e0fd1606c4a065e1a24194 add incremental
1 commits from heads/master converted; original: 4040c1631489c25dd4e0fd1606c4a065e1a24194; rewritten: d6ec61184bff36a58159341c2584f3cda9dd0b58
converting 1 Git commits
scanning source...
sorting...
converting...
0 add incremental
- 1 Git commits converted to Mercurial; previous tip: 10:74b93af557b18fa56b0e9fad513ef9da1a1d950f; current tip: 11:b53d6fba975e3face586964aace142716b2191a7
+ 1 Git commits converted to Mercurial; previous tip: 10:7d80acaa161029d9e746e3125e7cc0916406403f; current tip: 11:bb82033b3f2dca56396a933e94a1ed802ae5cd26
checking for outgoing changesets to file://$TESTTMP/hg-mirror
pushing to file://$TESTTMP/hg-mirror
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
--- a/vcssync/tests/test-linearize-git-to-hg-source-annotations.t
+++ b/vcssync/tests/test-linearize-git-to-hg-source-annotations.t
@@ -35,29 +35,27 @@ Note: since source repo is in $TESTTMP w
4 create file1-20, file1-50 and file1-80 as copies with mods
3 dummy commit 1 on master
2 dummy commit 2 on master
1 Merge branch 'head2'
0 dummy commit 1 after merge
11 Git commits converted to Mercurial; previous tip: -1:0000000000000000000000000000000000000000; current tip: 10:* (glob)
Key: Value metadata identifying source should appear in commit message
-TODO Mercurial 4.1 will remove convert_revision from extra, which is wanted
$ hg -R grepo-dest log --debug -r 0
changeset: 0:* (glob)
phase: draft
parent: -1:0000000000000000000000000000000000000000
parent: -1:0000000000000000000000000000000000000000
manifest: 0:cba485ca3678256e044428f70f58291196f6e9de
user: test <test@example.com>
date: Thu Jan 01 00:00:00 1970 +0000
files+: foo
extra: branch=default
- extra: convert_revision=* (glob)
description:
initial
Source-Repo: file://$TESTTMP/grepo
Source-Revision: dbd62b82aaf0a7a05665d9455a9b4d490d52ddaf