##// END OF EJS Templates
rebase: add a test showing that --dry-run wipes working copy changes...
Raphaël Gomès -
r51291:b469c5ce stable
parent child Browse files
Show More
@@ -0,0 +1,99 b''
1 ======================
2 rebase --dry-run tests
3 ======================
4
5 Test behavior associated with `hg rebase --dry-run`
6
7 Setup
8 =====
9
10 $ hg init r1
11 $ cd r1
12 $ echo one > f01.txt
13 $ echo two > f02.txt
14 $ echo three > f03.txt
15 $ hg add
16 adding f01.txt
17 adding f02.txt
18 adding f03.txt
19 $ hg ci -m 'ci-1' f01.txt f02.txt f03.txt
20 $ hg book base; hg book -i
21 $ echo add-to-one >> f01.txt
22 $ hg ci -m 'br-1' f01.txt
23 $ hg book branch-1; hg book -i
24 $ hg up base; hg book -i
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 (activating bookmark base)
27 $ echo add-to-two >> f02.txt
28 $ hg ci -m 'br-2' f02.txt
29 created new head
30 $ hg book branch-2; hg book -i
31 $ hg up branch-1; hg book -i
32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 (activating bookmark branch-1)
34 $ hg log -G
35 o changeset: 2:d408211b0a6f
36 | bookmark: branch-2
37 | tag: tip
38 | parent: 0:99418d161ee0
39 | user: test
40 | date: Thu Jan 01 00:00:00 1970 +0000
41 | summary: br-2
42 |
43 | @ changeset: 1:ab62441498e5
44 |/ bookmark: branch-1
45 | user: test
46 | date: Thu Jan 01 00:00:00 1970 +0000
47 | summary: br-1
48 |
49 o changeset: 0:99418d161ee0
50 bookmark: base
51 user: test
52 date: Thu Jan 01 00:00:00 1970 +0000
53 summary: ci-1
54
55
56
57 Check the working copy changes do not get wiped out
58 ===================================================
59
60 $ echo add-to-three >> f03.txt
61
62 f03 is modified
63
64 $ hg st
65 M f03.txt
66 $ hg diff
67 diff -r ab62441498e5 f03.txt
68 --- a/f03.txt Thu Jan 01 00:00:00 1970 +0000
69 +++ b/f03.txt Thu Jan 01 00:00:00 1970 +0000
70 @@ -1,1 +1,2 @@
71 three
72 +add-to-three
73
74
75 $ hg rebase -v -n -s branch-2 -d branch-1 --config extensions.rebase=
76 starting dry-run rebase; repository will not be changed
77 rebasing 2:d408211b0a6f branch-2 tip "br-2"
78 resolving manifests
79 getting f02.txt
80 committing files:
81 f02.txt
82 committing manifest
83 committing changelog
84 rebase merging completed
85 dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
86 resolving manifests (known-bad-output !)
87 getting f03.txt (known-bad-output !)
88
89 f03 changes are lost
90
91 $ hg st
92 M f03.txt (missing-correct-output !)
93 $ hg diff
94 diff -r ab62441498e5 f03.txt (missing-correct-output !)
95 --- a/f03.txt Thu Jan 01 00:00:00 1970 +0000 (missing-correct-output !)
96 +++ b/f03.txt Thu Jan 01 00:00:00 1970 +0000 (missing-correct-output !)
97 @@ -1,1 +1,2 @@ (missing-correct-output !)
98 three (missing-correct-output !)
99 +add-to-three (missing-correct-output !)
General Comments 0
You need to be logged in to leave comments. Login now