comparison tests/test-evolve-content-divergence.t @ 3790:5b9e3aaa6da8

evolve: prompt user for branch selection while resolving content-divergence When resolving content-divergence, there can be case when both the content-divergent changesets are on different named branches. In that case, we are not sure which branch should the resolution commit should be on. This patch adds logic to prompt user to choose the branch which the resolution commit should be on and then creates the new resolution commit on that branch. This also adds a new test file which have tests for the branch selection feature we have added.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 04 Jun 2018 04:03:02 +0530
parents
children ee78135b2f45
comparison
equal deleted inserted replaced
3789:13eef43a961f 3790:5b9e3aaa6da8
1 ** Test for handling of content divergent changesets by `hg evolve` **
2 ====================================================================
3
4 $ cat >> $HGRCPATH <<EOF
5 > [alias]
6 > glog = log -GT "{rev}:{node|short} {desc|firstline}\n ({bookmarks}) [{branch}] {phase}"
7 > [extensions]
8 > EOF
9 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
10
11 $ hg init cdiv
12 $ cd cdiv
13 $ echo ".*\.orig" > .hgignore
14 $ hg add .hgignore
15 $ hg ci -m "added hgignore"
16 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
17
18 $ hg glog
19 @ 4:c41c793e0ef1 added d
20 | () [default] draft
21 o 3:ca1b80f7960a added c
22 | () [default] draft
23 o 2:b1661037fa25 added b
24 | () [default] draft
25 o 1:c7586e2a9264 added a
26 | () [default] draft
27 o 0:8fa14d15e168 added hgignore
28 () [default] draft
29
30 Creating content-divergence with branch change
31 ----------------------------------------------
32
33 $ hg branch -r . foobar
34 changed branch on 1 changesets
35
36 $ hg up c41c793e0ef1 --hidden
37 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 updated to hidden changeset c41c793e0ef1
39 (hidden revision 'c41c793e0ef1' was rewritten as: 9e5dffcb3d48)
40 working directory parent is obsolete! (c41c793e0ef1)
41 (use 'hg evolve' to update to its successor: 9e5dffcb3d48)
42 $ echo bar > d
43 $ hg branch watwat
44 marked working directory as branch watwat
45 $ hg amend
46 2 new content-divergent changesets
47
48 $ hg glog
49 @ 6:264b04f771fb added d
50 | () [watwat] draft
51 | * 5:9e5dffcb3d48 added d
52 |/ () [foobar] draft
53 o 3:ca1b80f7960a added c
54 | () [default] draft
55 o 2:b1661037fa25 added b
56 | () [default] draft
57 o 1:c7586e2a9264 added a
58 | () [default] draft
59 o 0:8fa14d15e168 added hgignore
60 () [default] draft
61
62 $ hg evolve --content-divergent --config ui.interactive=True<<EOF
63 > c
64 > EOF
65 merge:[6] added d
66 with: [5] added d
67 base: [4] added d
68 merging "other" content-divergent changeset '9e5dffcb3d48'
69 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 content divergent changesets on different branches.
71 choose branch for the resolution changeset. (a) default or (b) watwat or (c) foobar? c
72 working directory is now at 23a4467c278e
73
74 $ hg glog
75 @ 7:23a4467c278e added d
76 | () [foobar] draft
77 o 3:ca1b80f7960a added c
78 | () [default] draft
79 o 2:b1661037fa25 added b
80 | () [default] draft
81 o 1:c7586e2a9264 added a
82 | () [default] draft
83 o 0:8fa14d15e168 added hgignore
84 () [default] draft