sapling/eden/scm/tests/test-mutation-infinitepush.t

144 lines
4.5 KiB
Perl
Raw Normal View History

#require py2
#chg-compatible
$ disable treemanifest
$ enable amend rebase histedit fbhistedit remotenames
$ setconfig experimental.evolution=obsolete
$ setconfig experimental.narrow-heads=true
$ setconfig visibility.enabled=true
$ setconfig mutation.record=true mutation.enabled=true mutation.date="0 0"
$ . "$TESTDIR/library.sh"
$ . "$TESTDIR/infinitepush/library.sh"
$ cp $HGRCPATH $TESTTMP/defaulthgrc
$ setupcommon
$ hg init repo
$ cd repo
$ setupserver
$ cd ..
$ hg clone ssh://user@dummy/repo client -q
$ cd client
$ mkcommit initialcommit
$ hg push -q -r . --create --to foo
$ mkcommit scratchcommit
Make a scratch branch with an initial commit.
$ hg push -q -r . --to scratch/mybranch --create
Amend the commit a couple of times and push to the scratch branch again
$ hg amend -m "scratchcommit (amended 1)"
$ hg amend -m "scratchcommit (amended 2)"
$ hg push -q -r . --to scratch/mybranch --non-forward-move
Clone the repo again, and pull the scratch branch.
$ cd ..
$ hg clone ssh://user@dummy/repo client2 -q
$ cd client2
$ hg pull -q -B scratch/mybranch
Amend the commit a couple of times again.
$ hg up tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "scratchcommit (amended 3)"
$ hg amend -m "scratchcommit (amended 4)"
$ hg push -q -r . --to scratch/mybranch --non-forward-move
Pull the branch back into the original repo.
$ cd ..
$ cd client
$ hg pull -B scratch/mybranch
pulling from ssh://user@dummy/repo
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 0 changes to 1 files
$ hg up -q tip
We have the predecessor chain that links all versions of the commits.
This works even though we are missing the third amended version.
$ hg log -r 'predecessors(.)' -T '{node|short} {desc}\n' --hidden
20759b6926ce scratchcommit
ef7d26c88be0 scratchcommit (amended 1)
598fd30ad501 scratchcommit (amended 2)
f1f3b31bcda8 scratchcommit (amended 4)
Something more complicated involving splits and folds.
$ drawdag --print <<EOS
> E # split: A -> C,D
> | # rebase: B -> E
> B D F # fold: D, E -> F
> | |/
> A C
> | |
> f1f3b
> EOS
f9407b1692b9 A
80b4b0467fc6 B
91713f37cee7 C
113fbb421191 D
798e89a318d8 E
9d3e6062ef0c F
f1f3b31bcda8 f1f3b
$ A=f9407b1692b9
$ C=91713f37cee7
$ hg up -q $F
Push commit A to a scratch branch, simulating a pushbackup.
$ hg push --to scratch/$A -r $A --create --hidden
pushing to ssh://user@dummy/repo
searching for changes
remote: pushing 2 commits:
remote: f1f3b31bcda8 scratchcommit (amended 4)
remote: f9407b1692b9 A
Push the current commit to the scratch branch.
$ hg push --to scratch/mybranch -r .
pushing to ssh://user@dummy/repo
searching for changes
remote: pushing 3 commits:
remote: f1f3b31bcda8 scratchcommit (amended 4)
remote: 91713f37cee7 C
remote: 9d3e6062ef0c F
Pull the scratch branch and commit A into the repo.
$ cd ..
$ cd client2
$ hg pull -q -B scratch/mybranch
$ hg pull -q -r $A
$ hg up -q $F
The predecessor information successfully reaches from F to A
$ hg log -r "predecessors(.)" -T "{node|short} {desc}\n" --hidden
9d3e6062ef0c F
f9407b1692b9 A
The successor information succesfully reaches from A to C and F (it was split)
$ hg log -r "successors($A)" -T "{node|short} {desc}\n" --hidden
91713f37cee7 C
9d3e6062ef0c F
f9407b1692b9 A
Clone the repo again, and pull an earlier commit. This will cause the server to rebundle.
$ cd ..
$ hg clone ssh://user@dummy/repo client3 -q
$ cd client3
$ hg pull -q -r $C
Check the history of the commits has been included.
$ hg debugmutation f1f3b
mutation: make the mutationstore the source of truth for mutation entries Summary: Previously the mutation commit extras were the source of truth for mutation information, and the mutation store served as a kind of cache. This turned out to be less useful than expected, as oftentimes commits are missing, and the store is better indexed, so in practice using the store as the source of truth is better. This change makes the mutationstore the (sole) source of truth for mutation data. The extras are kept, but they are now only useful as human-readable debug information, and to ensure the commit hash is unique. Collecting the mutation information during commit creation is now done through a new `mutinfo` object. This is a dict with the same keys as the mutation extras, for simplicity, but it is now passed through the `committablectx` and used to generate the mutation store entry directly. The `mutation.enabled` config option is now used to control all aspects of enabling mutation. The `mutation.record` config option is now only used to indicate whether the mutation extras should also added to the commit. Generally this should be set to `true`, however the option is retained so that mutation extras can be stripped by running `hg amend --config mutation.record=false`, which no longer has the side-effect of not recording mutation information to the store. The "remote commit" mutation record origin is now obsolete, and won't be generated anymore. Pushrebase now relies on the obsmarker information coming back from the server in order to correctly generate mutation information. We will need to change this so that the server returns mutation records before we can fully deprecate obsmarkers. Reviewed By: DurhamG Differential Revision: D19410650 fbshipit-source-id: 8d7094e4bfd8d8e97916898d899a8debd339485f
2020-01-16 12:01:10 +03:00
* f1f3b31bcda86dbc8fe6a31ba7c6893bee792127 amend by test at 1970-01-01T00:00:00 from:
01c5cd3313b899dca3e059b77aa454e0e2b5df7b amend by test at 1970-01-01T00:00:00 from:
598fd30ad50172d0389be262a242092f221bd196 amend by test at 1970-01-01T00:00:00 from:
ef7d26c88be0bf3c8d40a3569fd9c018f32a19ab amend by test at 1970-01-01T00:00:00 from:
20759b6926ce827d5a8c73eb1fa9726d6f7defb2
Pulling in an earlier predecessor makes the predecessor show up.
$ hg pull -q -r $A
$ hg log -r "predecessors($C)" -T '{node} {desc}\n' --hidden
91713f37cee74b0145e53c32cf3fef354944ce4d C
f9407b1692b919f7a3e45186464e2256e67c1be5 A
$ hg log -r "successors($A)" -T '{node} {desc}\n' --hidden
91713f37cee74b0145e53c32cf3fef354944ce4d C
f9407b1692b919f7a3e45186464e2256e67c1be5 A