##// END OF EJS Templates
mq: add basic tests
Vadim Gelfer -
r2729:8ce86d2c default
parent child Browse files
Show More
@@ -0,0 +1,114 b''
1 #!/bin/sh
2
3 HGRCPATH=$HGTMP/.hgrc; export HGRCPATH
4 echo "[extensions]" >> $HGTMP/.hgrc
5 echo "mq=" >> $HGTMP/.hgrc
6
7 echo % help
8 hg help mq
9
10 hg init a
11 cd a
12 echo a > a
13 mkdir b
14 echo z > b/z
15 hg ci -Ama
16
17 echo % qinit
18
19 hg qinit
20
21 cd ..
22 hg init b
23
24 echo % -R qinit
25
26 hg -R b qinit
27
28 hg init c
29
30 echo % qinit -c
31
32 hg --cwd c qinit -c
33 hg -R c/.hg/patches st
34
35 echo % qnew implies add
36
37 hg -R c qnew test.patch
38 hg -R c/.hg/patches st
39
40 cd a
41
42 echo % qnew -m
43
44 hg qnew -m 'foo bar' test.patch
45 cat .hg/patches/test.patch
46
47 echo % qrefresh
48
49 echo a >> a
50 hg qrefresh
51 sed -e "s/\(^diff -r \)\([a-f0-9]* \)/\1 x/" \
52 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
53 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
54
55 echo % qpop
56
57 hg qpop
58
59 echo % qpush
60
61 hg qpush
62
63 cd ..
64
65 echo % pop/push outside repo
66
67 hg -R a qpop
68 hg -R a qpush
69
70 cd a
71 hg qnew test2.patch
72
73 echo % qrefresh in subdir
74
75 cd b
76 echo a > a
77 hg add a
78 hg qrefresh
79
80 echo % pop/push -a in subdir
81
82 hg qpop -a
83 hg --traceback qpush -a
84
85 echo % qseries
86 hg qseries
87
88 echo % qapplied
89 hg qapplied
90
91 echo % qtop
92 hg qtop
93
94 echo % qprev
95 hg qprev
96
97 echo % qnext
98 hg qnext
99
100 echo % pop, qnext, qprev, qapplied
101 hg qpop
102 hg qnext
103 hg qprev
104 hg qapplied
105
106 echo % qunapplied
107 hg qunapplied
108
109 echo % strip
110 cd ../../b
111 echo x>x
112 hg ci -Ama
113 hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
114 hg unbundle .hg/strip-backup/*
@@ -0,0 +1,111 b''
1 % help
2 mq extension - patch management and development
3
4 This extension lets you work with a stack of patches in a Mercurial
5 repository. It manages two stacks of patches - all known patches, and
6 applied patches (subset of known patches).
7
8 Known patches are represented as patch files in the .hg/patches
9 directory. Applied patches are both patch files and changesets.
10
11 Common tasks (use "hg help command" for more details):
12
13 prepare repository to work with patches qinit
14 create new patch qnew
15 import existing patch qimport
16
17 print patch series qseries
18 print applied patches qapplied
19 print name of top applied patch qtop
20
21 add known patch to applied stack qpush
22 remove patch from applied stack qpop
23 refresh contents of top applied patch qrefresh
24
25 list of commands (use "hg help -v mq" to show aliases and global options):
26
27 qapplied print the patches already applied
28 qclone clone main and patch repository at same time
29 qcommit commit changes in the queue repository
30 qdelete remove a patch from the series file
31 qdiff diff of the current patch
32 qimport import a patch
33 qinit init a new queue repository
34 qnew create a new patch
35 qnext print the name of the next patch
36 qpop pop the current patch off the stack
37 qprev print the name of the previous patch
38 qpush push the next patch onto the stack
39 qrefresh update the current patch
40 qrestore restore the queue state saved by a rev
41 qsave save current queue state
42 qseries print the entire series file
43 qtop print the name of the current patch
44 qunapplied print the patches not yet applied
45 qversion print the version number
46 strip strip a revision and all later revs on the same branch
47 adding a
48 adding b/z
49 % qinit
50 % -R qinit
51 % qinit -c
52 A .hgignore
53 A series
54 % qnew implies add
55 A .hgignore
56 A series
57 A test.patch
58 % qnew -m
59 foo bar
60 % qrefresh
61 foo bar
62
63 diff -r xa
64 --- a/a
65 +++ b/a
66 @@ -1,1 +1,2 @@ a
67 a
68 +a
69 % qpop
70 Patch queue now empty
71 % qpush
72 applying test.patch
73 Now at: test.patch
74 % pop/push outside repo
75 Patch queue now empty
76 applying test.patch
77 Now at: test.patch
78 % qrefresh in subdir
79 % pop/push -a in subdir
80 Patch queue now empty
81 applying test.patch
82 applying test2.patch
83 Now at: test2.patch
84 % qseries
85 test.patch
86 test2.patch
87 % qapplied
88 test.patch
89 test2.patch
90 % qtop
91 test2.patch
92 % qprev
93 test.patch
94 % qnext
95 All patches applied
96 % pop, qnext, qprev, qapplied
97 Now at: test.patch
98 test2.patch
99 Only one patch applied
100 test.patch
101 % qunapplied
102 test2.patch
103 % strip
104 adding x
105 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
106 saving bundle to
107 adding changesets
108 adding manifests
109 adding file changes
110 added 1 changesets with 1 changes to 1 files
111 (run 'hg update' to get a working copy)
General Comments 0
You need to be logged in to leave comments. Login now