File: test-mq-safety

package info (click to toggle)
mercurial 1.6.4-1%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 17,928 kB
  • ctags: 6,062
  • sloc: python: 44,238; sh: 20,985; tcl: 3,578; ansic: 2,557; lisp: 1,412; makefile: 176; xml: 15
file content (90 lines) | stat: -rwxr-xr-x 1,568 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/sh

echo '[extensions]' >> $HGRCPATH
echo 'mq =' >> $HGRCPATH

hg init repo
cd repo

echo foo > foo
hg ci -qAm 'add a file'

hg qinit

hg qnew foo
echo foo >> foo
hg qrefresh -m 'append foo'

hg qnew bar
echo bar >> foo
hg qrefresh -m 'append bar'

echo '% try to commit on top of a patch'
echo quux >> foo
hg ci -m 'append quux'

# cheat a bit...
mv .hg/patches .hg/patches2
hg ci -m 'append quux'
mv .hg/patches2 .hg/patches

echo '% qpop/qrefresh on the wrong revision'
hg qpop
hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
hg qrefresh

hg up -C qtip
echo '% qpop'
hg qpop

echo '% qrefresh'
hg qrefresh

echo '% tip:'
hg tip --template '{rev} {desc}\n'

echo '% qpush warning branchheads'
cd ..
hg init branchy
cd branchy
echo q > q
hg add q
hg qnew -f qp
hg qpop
echo a > a
hg ci -Ama
hg up null
hg branch b
echo c > c
hg ci -Amc
hg merge default
hg ci -mmerge
hg up default
hg log
hg qpush
cd ..

echo '% testing applied patches, push and --force'
hg init forcepush
cd forcepush
echo a > a
hg ci -Am adda
echo a >> a
hg ci -m changea
hg up 0
hg branch branch
echo b > b
hg ci -Am addb
hg up 0
hg --cwd .. clone -r 0 forcepush forcepush2
echo a >> a
hg qnew patch
echo '% pushing applied patch with --rev without --force'
hg push -r default ../forcepush2
echo '% pushing applied patch with branchhash, without --force'
hg push ../forcepush2#default
echo '% pushing revs excluding applied patch'
hg push --new-branch -r branch -r 2 ../forcepush2
echo '% pushing applied patch with --force'
hg push --force -r default ../forcepush2
cd ..