Mercurial > hg
annotate tests/test-convert-clonebranches.t @ 14732:e9ed3506f066 stable
backout of d04ba50e104d: allow to qpop/push with a dirty working copy
The new behavior was breaking existing tools that relied on a sequence such as
this:
1) start with a dirty working copy
2) qimport some patch
3) try to qpush it
4) old behavior would fail at this point due to outstanding changes.
(new behavior would only fail if the outstanding changes and the patches
changes intersect)
5) innocent user qrefreshes, gets his local changes in the imported patch
It's worth considering if we can move this behavior to -f in the future.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 24 Jun 2011 23:25:42 +0300 |
parents | 89f1210a1238 |
children | 41885892796e |
rev | line source |
---|---|
5934
e495f3f35b2d
convert: hg.clonebranches must pull missing parents (issue941)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 |
12518
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
2 $ echo "[extensions]" >> $HGRCPATH |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
3 $ echo "convert = " >> $HGRCPATH |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
4 $ echo "[convert]" >> $HGRCPATH |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
5 $ echo "hg.tagsbranch=0" >> $HGRCPATH |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
6 $ hg init source |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
7 $ cd source |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
8 $ echo a > a |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
9 $ hg ci -qAm adda |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
10 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
11 Add a merge with one parent in the same branch |
5934
e495f3f35b2d
convert: hg.clonebranches must pull missing parents (issue941)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 |
12518
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
13 $ echo a >> a |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
14 $ hg ci -qAm changea |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
15 $ hg up -qC 0 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
16 $ hg branch branch0 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
17 marked working directory as branch branch0 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
18 $ echo b > b |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
19 $ hg ci -qAm addb |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
20 $ hg up -qC |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
21 $ hg merge default |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
23 (branch merge, don't forget to commit) |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
24 $ hg ci -qm mergeab |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
25 $ hg tag -ql mergeab |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
26 $ cd .. |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
27 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
28 Miss perl... sometimes |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
29 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
30 $ cat > filter.py <<EOF |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
31 > import sys, re |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
32 > |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
33 > r = re.compile(r'^(?:\d+|pulling from)') |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
34 > sys.stdout.writelines([l for l in sys.stdin if r.search(l)]) |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
35 > EOF |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
36 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
37 convert |
5934
e495f3f35b2d
convert: hg.clonebranches must pull missing parents (issue941)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 |
12518
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
39 $ hg convert -v --config convert.hg.clonebranches=1 source dest | |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
40 > python filter.py |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
41 3 adda |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
42 2 changea |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
43 1 addb |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
44 pulling from default into branch0 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
45 1 changesets found |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
46 0 mergeab |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
47 pulling from default into branch0 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
48 1 changesets found |
5934
e495f3f35b2d
convert: hg.clonebranches must pull missing parents (issue941)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
49 |
12518
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
50 Add a merge with both parents and child in different branches |
5934
e495f3f35b2d
convert: hg.clonebranches must pull missing parents (issue941)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
51 |
12518
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
52 $ cd source |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
53 $ hg branch branch1 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
54 marked working directory as branch branch1 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
55 $ echo a > file1 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
56 $ hg ci -qAm c1 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
57 $ hg up -qC mergeab |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
58 $ hg branch branch2 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
59 marked working directory as branch branch2 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
60 $ echo a > file2 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
61 $ hg ci -qAm c2 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
62 $ hg merge branch1 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
64 (branch merge, don't forget to commit) |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
65 $ hg branch branch3 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
66 marked working directory as branch branch3 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
67 $ hg ci -qAm c3 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
68 $ cd .. |
5934
e495f3f35b2d
convert: hg.clonebranches must pull missing parents (issue941)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
69 |
12518
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
70 incremental conversion |
5934
e495f3f35b2d
convert: hg.clonebranches must pull missing parents (issue941)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
71 |
12518
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
72 $ hg convert -v --config convert.hg.clonebranches=1 source dest | |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
73 > python filter.py |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
74 2 c1 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
75 pulling from branch0 into branch1 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
76 4 changesets found |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
77 1 c2 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
78 pulling from branch0 into branch2 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
79 4 changesets found |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
80 0 c3 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
81 pulling from branch2 into branch3 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
82 5 changesets found |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
83 pulling from branch1 into branch3 |
89f1210a1238
tests: unify test-convert-clonebranches
Matt Mackall <mpm@selenic.com>
parents:
10119
diff
changeset
|
84 1 changesets found |