Debian Codegraph @

tests/test-narrow-rebase.t

raw
1 #testcases continuecommand continueflag
2 #if continueflag
3 $ cat >> $HGRCPATH <<EOF
4 > [alias]
5 > continue = rebase --continue
6 > EOF
7 #endif
8
9 $ . "$TESTDIR/narrow-library.sh"
10
11 create full repo
12
13 $ hg init master
14 $ cd master
15
16 $ mkdir inside
17 $ echo inside1 > inside/f1
18 $ echo inside2 > inside/f2
19 $ mkdir outside
20 $ echo outside1 > outside/f1
21 $ echo outside2 > outside/f2
22 $ hg ci -Aqm 'initial'
23
24 $ echo modified > inside/f1
25 $ hg ci -qm 'modify inside/f1'
26
27 $ hg update -q 0
28 $ echo modified2 > inside/f2
29 $ hg ci -qm 'modify inside/f2'
30
31 $ hg update -q 0
32 $ echo modified > outside/f1
33 $ hg ci -qm 'modify outside/f1'
34
35 $ hg update -q 0
36 $ echo modified2 > outside/f1
37 $ hg ci -qm 'conflicting outside/f1'
38
39 $ cd ..
40
41 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
42 requesting all changes
43 adding changesets
44 adding manifests
45 adding file changes
46 added 5 changesets with 4 changes to 2 files (+3 heads)
47 new changesets *:* (glob)
48 updating to branch default
49 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 $ cd narrow
51 $ cat >> $HGRCPATH <<EOF
52 > [extensions]
53 > rebase=
54 > EOF
55
56 $ hg update -q 0
57
58 Can rebase onto commit where no files outside narrow spec are involved
59
60 $ hg update -q 0
61 $ echo modified > inside/f2
62 $ hg ci -qm 'modify inside/f2'
63 $ hg rebase -d 'desc("modify inside/f1")'
64 rebasing 5:c2f36d04e05d tip "modify inside/f2"
65 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-rebase.hg (glob)
66
67 Can rebase onto conflicting changes inside narrow spec
68
69 $ hg update -q 0
70 $ echo conflicting > inside/f1
71 $ hg ci -qm 'conflicting inside/f1'
72 $ hg rebase -d 'desc("modify inside/f1")' 2>&1 | grep -E -v '(warning:|incomplete!)'
73 rebasing 6:cdce97fbf653 tip "conflicting inside/f1"
74 merging inside/f1
75 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
76 $ echo modified3 > inside/f1
77 $ hg resolve -m 2>&1 | grep -v continue:
78 (no more unresolved files)
79 $ hg continue
80 rebasing 6:cdce97fbf653 tip "conflicting inside/f1"
81 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-rebase.hg (glob)
82
83 Can rebase onto non-conflicting changes outside narrow spec
84
85 $ hg update -q 0
86 $ echo modified > inside/f2
87 $ hg ci -qm 'modify inside/f2'
88 $ hg rebase -d 'desc("modify outside/f1")'
89 rebasing 7:c2f36d04e05d tip "modify inside/f2"
90 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-rebase.hg (glob)
91
92 Rebase interrupts on conflicting changes outside narrow spec
93
94 $ hg update -q 'desc("conflicting outside/f1")'
95 $ hg phase -f -d .
96 $ hg rebase -d 'desc("modify outside/f1")'
97 rebasing 4:707c035aadb6 "conflicting outside/f1"
98 abort: conflict in file 'outside/f1' is outside narrow clone
99 [20]