Mercurial > evolve
annotate tests/test-evolve-extras.t @ 6889:a66cf9008781
obslog: also display patch for rebased changesets
This applies the same logic that is used for "merge-diff" to rebased
changesets. The successors' content is compared to the content of the
predecessors rebased in-memory on the new parents.
This highlights the changes that were actually introduced while rebasing (like
conflict resolution or API adjustment).
As a side effect, obslog now also outputs slightly more diffs for splits,
showing what parts of the original big changeset were moved to the smaller
split components (but for now it only works for the first few changesets).
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 22 Sep 2024 02:58:54 +0200 |
parents | e36883d88108 |
children |
rev | line source |
---|---|
6493
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
1 Testing retained_extras_on_rebase usage in evolve and modifying it in an extension |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
2 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
3 $ . $TESTDIR/testlib/common.sh |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
4 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
5 $ hg init repo |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
6 $ cd repo |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
7 $ cat > .hg/hgrc << EOF |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
8 > [extensions] |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
9 > evolve = |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
10 > EOF |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
11 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
12 $ echo apple > a |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
13 $ hg ci -qAm 'apple' |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
14 $ echo banana > b |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
15 $ hg ci -qAm 'banana' --config extensions.commitextras= \ |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
16 > --extra useful=b-for-banana \ |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
17 > --extra useless=banana-peel |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
18 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
19 amending apple |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
20 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
21 $ hg prev |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
22 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
23 [0] apple |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
24 $ echo apricot > a |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
25 $ hg amend -m 'apricot' |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
26 1 new orphan changesets |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
27 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
28 the commit still has all extras that we added previously |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
29 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
30 $ hg log -r 'desc("banana")' -T '{join(extras, " ")}\n' |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
31 *useful=b-for-banana*useless=banana-peel* (glob) |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
32 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
33 let's run evolve with our extension |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
34 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
35 $ hg --config extensions.retained_extras=${TESTDIR}/testlib/retain-extras-ext.py evolve |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
36 move:[1] banana |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
37 atop:[2] apricot |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
38 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
39 evolving banana retained "useful" and discarded "useless" |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
40 |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
41 $ hg log -r 'desc("banana")' -T '{join(extras, " ")}\n' |
e36883d88108
evolve: add a test to capture the expected behavior of retaining extras
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff
changeset
|
42 *useful=b-for-banana* (glob) |