D6949: sidedatacopies: introduce a sidedata testcase for test-copies-in-changeset.t
Closed by commit rHG5a790eac6b1e: sidedatacopies: introduce a sidedata testcase for test-copies-in-changeset.t (authored by marmoute). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6949?vs=16781=17004 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D6949/new/ REVISION DETAIL https://phab.mercurial-scm.org/D6949 AFFECTED FILES tests/test-copies-in-changeset.t CHANGE DETAILS diff --git a/tests/test-copies-in-changeset.t b/tests/test-copies-in-changeset.t --- a/tests/test-copies-in-changeset.t +++ b/tests/test-copies-in-changeset.t @@ -1,4 +1,6 @@ +#testcases extra sidedata +#if extra $ cat >> $HGRCPATH << EOF > [experimental] > copies.write-to=changeset-only @@ -7,6 +9,18 @@ > changesetcopies = log -r . -T 'files: {files} > {extras % "{ifcontains("files", key, "{key}: {value}\n")}"} > {extras % "{ifcontains("copies", key, "{key}: {value}\n")}"}' + > EOF +#endif + +#if sidedata + $ cat >> $HGRCPATH << EOF + > [format] + > exp-use-copies-side-data-changeset = yes + > EOF +#endif + + $ cat >> $HGRCPATH << EOF + > [alias] > showcopies = log -r . -T '{file_copies % "{source} -> {name}\n"}' > [extensions] > rebase = @@ -17,6 +31,31 @@ $ hg init repo $ cd repo +#if sidedata + $ hg debugformat -v + format-variantrepo config default + fncache: yesyes yes + dotencode: yesyes yes + generaldelta: yesyes yes + sparserevlog: yesyes yes + sidedata: yesyes no + copies-sdc:yesyes no + plain-cl-delta:yesyes yes + compression: zlib zlibzlib + compression-level: default default default +#else + $ hg debugformat -v + format-variantrepo config default + fncache: yesyes yes + dotencode: yesyes yes + generaldelta: yesyes yes + sparserevlog: yesyes yes + sidedata: no no no + copies-sdc: no no no + plain-cl-delta:yesyes yes + compression: zlib zlibzlib + compression-level: default default default +#endif $ echo a > a $ hg add a $ hg ci -m initial @@ -24,6 +63,9 @@ $ hg cp a c $ hg cp a d $ hg ci -m 'copy a to b, c, and d' + +#if extra + $ hg changesetcopies files: b c d filesadded: 0 @@ -33,29 +75,44 @@ p1copies: 0\x00a (esc) 1\x00a (esc) 2\x00a (esc) + +#endif + $ hg showcopies a -> b a -> c a -> d + +#if extra + $ hg showcopies --config experimental.copies.read-from=compatibility a -> b a -> c a -> d $ hg showcopies --config experimental.copies.read-from=filelog-only +#endif + Check that renames are recorded correctly $ hg mv b b2 $ hg ci -m 'rename b to b2' + +#if extra + $ hg changesetcopies files: b b2 filesadded: 1 filesremoved: 0 p1copies: 1\x00b (esc) + +#endif + $ hg showcopies b -> b2 + Rename onto existing file. This should get recorded in the changeset files list and in the extras, even though there is no filelog entry. @@ -63,20 +120,51 @@ $ hg st --copies M c b2 + +#if extra + $ hg debugindex c rev linkrev nodeid p1 p2 0 1 b789fdd96dc2 + +#else + + $ hg debugindex c + rev linkrev nodeid p1 p2 + 0 1 37d9b5d994ea + +#endif + + $ hg ci -m 'move b onto d' + +#if extra + $ hg changesetcopies files: c p1copies: 0\x00b2 (esc) + +#endif + $ hg showcopies b2 -> c + +#if extra + $ hg debugindex c rev linkrev nodeid p1 p2 0 1 b789fdd96dc2 +#else + + $ hg debugindex c + rev linkrev nodeid p1 p2 + 0 1 37d9b5d994ea + 1 3 029625640347 + +#endif + Create a merge commit with copying done during merge. $ hg co 0 @@ -96,6 +184,9 @@ File 'f' exists only in p1, so 'i' should be from p1 $ hg cp f i $ hg ci -m 'merge' + +#if extra + $ hg changesetcopies files: g h i filesadded: 0 @@ -105,6 +196,9 @@ p1copies: 0\x00a (esc) 2\x00f (esc) p2copies: 1\x00d (esc) + +#endif + $ hg showcopies a -> g d -> h @@ -113,6 +207,7 @@ Test writing to both changeset and filelog $ hg cp a j +#if extra $ hg ci -m 'copy a to j' --config experimental.copies.write-to=compatibility $ hg changesetcopies files: j @@ -121,6 +216,9 @@ p1copies: 0\x00a (esc) p2copies: +#else + $ hg ci -m 'copy a to j' +#endif $ hg debugdata j 0 \x01 (esc) copy: a @@ -135,17 +233,23 @@ a -> j Existing copy information in the changeset gets removed on amend and
D6949: sidedatacopies: introduce a sidedata testcase for test-copies-in-changeset.t
marmoute created this revision. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers. REVISION SUMMARY For now it is equivalent to the filelog case, but introducing this early helps make the comings changesets clearer. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6949 AFFECTED FILES tests/test-copies-in-changeset.t CHANGE DETAILS diff --git a/tests/test-copies-in-changeset.t b/tests/test-copies-in-changeset.t --- a/tests/test-copies-in-changeset.t +++ b/tests/test-copies-in-changeset.t @@ -1,4 +1,6 @@ +#testcases extra sidedata +#if extra $ cat >> $HGRCPATH << EOF > [experimental] > copies.write-to=changeset-only @@ -7,6 +9,18 @@ > changesetcopies = log -r . -T 'files: {files} > {extras % "{ifcontains("files", key, "{key}: {value}\n")}"} > {extras % "{ifcontains("copies", key, "{key}: {value}\n")}"}' + > EOF +#endif + +#if sidedata + $ cat >> $HGRCPATH << EOF + > [format] + > exp-use-copies-side-data-changeset = yes + > EOF +#endif + + $ cat >> $HGRCPATH << EOF + > [alias] > showcopies = log -r . -T '{file_copies % "{source} -> {name}\n"}' > [extensions] > rebase = @@ -17,6 +31,31 @@ $ hg init repo $ cd repo +#if sidedata + $ hg debugformat -v + format-variantrepo config default + fncache: yesyes yes + dotencode: yesyes yes + generaldelta: yesyes yes + sparserevlog: yesyes yes + sidedata: yesyes no + copies-sdc:yesyes no + plain-cl-delta:yesyes yes + compression: zlib zlibzlib + compression-level: default default default +#else + $ hg debugformat -v + format-variantrepo config default + fncache: yesyes yes + dotencode: yesyes yes + generaldelta: yesyes yes + sparserevlog: yesyes yes + sidedata: no no no + copies-sdc: no no no + plain-cl-delta:yesyes yes + compression: zlib zlibzlib + compression-level: default default default +#endif $ echo a > a $ hg add a $ hg ci -m initial @@ -24,6 +63,9 @@ $ hg cp a c $ hg cp a d $ hg ci -m 'copy a to b, c, and d' + +#if extra + $ hg changesetcopies files: b c d filesadded: 0 @@ -33,29 +75,44 @@ p1copies: 0\x00a (esc) 1\x00a (esc) 2\x00a (esc) + +#endif + $ hg showcopies a -> b a -> c a -> d + +#if extra + $ hg showcopies --config experimental.copies.read-from=compatibility a -> b a -> c a -> d $ hg showcopies --config experimental.copies.read-from=filelog-only +#endif + Check that renames are recorded correctly $ hg mv b b2 $ hg ci -m 'rename b to b2' + +#if extra + $ hg changesetcopies files: b b2 filesadded: 1 filesremoved: 0 p1copies: 1\x00b (esc) + +#endif + $ hg showcopies b -> b2 + Rename onto existing file. This should get recorded in the changeset files list and in the extras, even though there is no filelog entry. @@ -63,20 +120,51 @@ $ hg st --copies M c b2 + +#if extra + $ hg debugindex c rev linkrev nodeid p1 p2 0 1 b789fdd96dc2 + +#else + + $ hg debugindex c + rev linkrev nodeid p1 p2 + 0 1 37d9b5d994ea + +#endif + + $ hg ci -m 'move b onto d' + +#if extra + $ hg changesetcopies files: c p1copies: 0\x00b2 (esc) + +#endif + $ hg showcopies b2 -> c + +#if extra + $ hg debugindex c rev linkrev nodeid p1 p2 0 1 b789fdd96dc2 +#else + + $ hg debugindex c + rev linkrev nodeid p1 p2 + 0 1 37d9b5d994ea + 1 3 029625640347 + +#endif + Create a merge commit with copying done during merge. $ hg co 0 @@ -96,6 +184,9 @@ File 'f' exists only in p1, so 'i' should be from p1 $ hg cp f i $ hg ci -m 'merge' + +#if extra + $ hg changesetcopies files: g h i filesadded: 0 @@ -105,6 +196,9 @@ p1copies: 0\x00a (esc) 2\x00f (esc) p2copies: 1\x00d (esc) + +#endif + $ hg showcopies a -> g d -> h @@ -113,6 +207,7 @@ Test writing to both changeset and filelog $ hg cp a j +#if extra $ hg ci -m 'copy a to j' --config experimental.copies.write-to=compatibility $ hg changesetcopies files: j @@ -121,6 +216,9 @@ p1copies: 0\x00a (esc) p2copies: +#else + $ hg ci -m 'copy a to j' +#endif $ hg debugdata j 0 \x01 (esc) copy: a @@ -135,17 +233,23 @@ a -> j Existing copy information in the changeset gets removed on amend and writing copy information on to the filelog +#if extra $ hg ci --amend -m 'copy a to j, v2' \ > --config experimental.copies.write-to=filelog-only - saved backup bundle to