##// END OF EJS Templates
mq: add parent node IDs to MQ patches on qrefresh/qnew...
Steve Losh -
r10397:8cb81d75 default
parent child Browse files
Show More
@@ -68,7 +68,7 b' class statusentry(object):'
68 return self.rev + ':' + self.name
68 return self.rev + ':' + self.name
69
69
70 class patchheader(object):
70 class patchheader(object):
71 def __init__(self, pf):
71 def __init__(self, pf, plainmode=False):
72 def eatdiff(lines):
72 def eatdiff(lines):
73 while lines:
73 while lines:
74 l = lines[-1]
74 l = lines[-1]
@@ -90,6 +90,7 b' class patchheader(object):'
90 comments = []
90 comments = []
91 user = None
91 user = None
92 date = None
92 date = None
93 parent = None
93 format = None
94 format = None
94 subject = None
95 subject = None
95 diffstart = 0
96 diffstart = 0
@@ -112,6 +113,8 b' class patchheader(object):'
112 user = line[7:]
113 user = line[7:]
113 elif line.startswith("# Date "):
114 elif line.startswith("# Date "):
114 date = line[7:]
115 date = line[7:]
116 elif line.startswith("# Parent "):
117 parent = line[9:]
115 elif not line.startswith("# ") and line:
118 elif not line.startswith("# ") and line:
116 message.append(line)
119 message.append(line)
117 format = None
120 format = None
@@ -126,6 +129,10 b' class patchheader(object):'
126 line.startswith("from: "))):
129 line.startswith("from: "))):
127 user = line[6:]
130 user = line[6:]
128 format = "tag"
131 format = "tag"
132 elif (format != "tagdone" and (line.startswith("Date: ") or
133 line.startswith("date: "))):
134 date = line[6:]
135 format = "tag"
129 elif format == "tag" and line == "":
136 elif format == "tag" and line == "":
130 # when looking for tags (subject: from: etc) they
137 # when looking for tags (subject: from: etc) they
131 # end once you find a blank line in the source
138 # end once you find a blank line in the source
@@ -148,7 +155,9 b' class patchheader(object):'
148 self.comments = comments
155 self.comments = comments
149 self.user = user
156 self.user = user
150 self.date = date
157 self.date = date
158 self.parent = parent
151 self.haspatch = diffstart > 1
159 self.haspatch = diffstart > 1
160 self.plainmode = plainmode
152
161
153 def setuser(self, user):
162 def setuser(self, user):
154 if not self.updateheader(['From: ', '# User '], user):
163 if not self.updateheader(['From: ', '# User '], user):
@@ -156,7 +165,7 b' class patchheader(object):'
156 patchheaderat = self.comments.index('# HG changeset patch')
165 patchheaderat = self.comments.index('# HG changeset patch')
157 self.comments.insert(patchheaderat + 1, '# User ' + user)
166 self.comments.insert(patchheaderat + 1, '# User ' + user)
158 except ValueError:
167 except ValueError:
159 if self._hasheader(['Date: ']):
168 if self.plainmode or self._hasheader(['Date: ']):
160 self.comments = ['From: ' + user] + self.comments
169 self.comments = ['From: ' + user] + self.comments
161 else:
170 else:
162 tmp = ['# HG changeset patch', '# User ' + user, '']
171 tmp = ['# HG changeset patch', '# User ' + user, '']
@@ -169,13 +178,22 b' class patchheader(object):'
169 patchheaderat = self.comments.index('# HG changeset patch')
178 patchheaderat = self.comments.index('# HG changeset patch')
170 self.comments.insert(patchheaderat + 1, '# Date ' + date)
179 self.comments.insert(patchheaderat + 1, '# Date ' + date)
171 except ValueError:
180 except ValueError:
172 if self._hasheader(['From: ']):
181 if self.plainmode or self._hasheader(['From: ']):
173 self.comments = ['Date: ' + date] + self.comments
182 self.comments = ['Date: ' + date] + self.comments
174 else:
183 else:
175 tmp = ['# HG changeset patch', '# Date ' + date, '']
184 tmp = ['# HG changeset patch', '# Date ' + date, '']
176 self.comments = tmp + self.comments
185 self.comments = tmp + self.comments
177 self.date = date
186 self.date = date
178
187
188 def setparent(self, parent):
189 if not self.updateheader(['# Parent '], parent):
190 try:
191 patchheaderat = self.comments.index('# HG changeset patch')
192 self.comments.insert(patchheaderat + 1, '# Parent ' + parent)
193 except ValueError:
194 pass
195 self.parent = parent
196
179 def setmessage(self, message):
197 def setmessage(self, message):
180 if self.comments:
198 if self.comments:
181 self._delmsg()
199 self._delmsg()
@@ -245,6 +263,7 b' class queue(object):'
245 self.gitmode = gitmode and 'yes' or 'no'
263 self.gitmode = gitmode and 'yes' or 'no'
246 except error.ConfigError:
264 except error.ConfigError:
247 self.gitmode = ui.config('mq', 'git', 'auto').lower()
265 self.gitmode = ui.config('mq', 'git', 'auto').lower()
266 self.plainmode = ui.configbool('mq', 'plain', False)
248
267
249 @util.propertycache
268 @util.propertycache
250 def applied(self):
269 def applied(self):
@@ -509,7 +528,7 b' class queue(object):'
509 if n is None:
528 if n is None:
510 raise util.Abort(_("repo commit failed"))
529 raise util.Abort(_("repo commit failed"))
511 try:
530 try:
512 ph = patchheader(mergeq.join(patch))
531 ph = patchheader(mergeq.join(patch), self.plainmode)
513 except:
532 except:
514 raise util.Abort(_("unable to read %s") % patch)
533 raise util.Abort(_("unable to read %s") % patch)
515
534
@@ -639,7 +658,7 b' class queue(object):'
639 pf = os.path.join(patchdir, patchname)
658 pf = os.path.join(patchdir, patchname)
640
659
641 try:
660 try:
642 ph = patchheader(self.join(patchname))
661 ph = patchheader(self.join(patchname), self.plainmode)
643 except:
662 except:
644 self.ui.warn(_("unable to read %s\n") % patchname)
663 self.ui.warn(_("unable to read %s\n") % patchname)
645 err = 1
664 err = 1
@@ -831,14 +850,20 b' class queue(object):'
831 # if patch file write fails, abort early
850 # if patch file write fails, abort early
832 p = self.opener(patchfn, "w")
851 p = self.opener(patchfn, "w")
833 try:
852 try:
834 if date:
853 if self.plainmode:
854 if user:
855 p.write("From: " + user + "\n")
856 if not date:
857 p.write("\n")
858 if date:
859 p.write("Date: %d %d\n\n" % date)
860 else:
835 p.write("# HG changeset patch\n")
861 p.write("# HG changeset patch\n")
862 p.write("# Parent " + hex(repo[None].parents()[0].node()) + "\n")
836 if user:
863 if user:
837 p.write("# User " + user + "\n")
864 p.write("# User " + user + "\n")
838 p.write("# Date %d %d\n\n" % date)
865 if date:
839 elif user:
866 p.write("# Date %s %s\n\n" % date)
840 p.write("From: " + user + "\n\n")
841
842 if hasattr(msg, '__call__'):
867 if hasattr(msg, '__call__'):
843 msg = msg()
868 msg = msg()
844 commitmsg = msg and msg or ("[mq]: %s" % patchfn)
869 commitmsg = msg and msg or ("[mq]: %s" % patchfn)
@@ -1214,7 +1239,7 b' class queue(object):'
1214
1239
1215 cparents = repo.changelog.parents(top)
1240 cparents = repo.changelog.parents(top)
1216 patchparent = self.qparents(repo, top)
1241 patchparent = self.qparents(repo, top)
1217 ph = patchheader(self.join(patchfn))
1242 ph = patchheader(self.join(patchfn), self.plainmode)
1218 diffopts = self.diffopts({'git': opts.get('git')}, patchfn)
1243 diffopts = self.diffopts({'git': opts.get('git')}, patchfn)
1219 if msg:
1244 if msg:
1220 ph.setmessage(msg)
1245 ph.setmessage(msg)
@@ -1222,6 +1247,7 b' class queue(object):'
1222 ph.setuser(newuser)
1247 ph.setuser(newuser)
1223 if newdate:
1248 if newdate:
1224 ph.setdate(newdate)
1249 ph.setdate(newdate)
1250 ph.setparent(hex(patchparent))
1225
1251
1226 # only commit new patch when write is complete
1252 # only commit new patch when write is complete
1227 patchf = self.opener(patchfn, 'w', atomictemp=True)
1253 patchf = self.opener(patchfn, 'w', atomictemp=True)
@@ -1406,7 +1432,7 b' class queue(object):'
1406 summary=False):
1432 summary=False):
1407 def displayname(pfx, patchname):
1433 def displayname(pfx, patchname):
1408 if summary:
1434 if summary:
1409 ph = patchheader(self.join(patchname))
1435 ph = patchheader(self.join(patchname), self.plainmode)
1410 msg = ph.message and ph.message[0] or ''
1436 msg = ph.message and ph.message[0] or ''
1411 if self.ui.interactive():
1437 if self.ui.interactive():
1412 width = util.termwidth() - len(pfx) - len(patchname) - 2
1438 width = util.termwidth() - len(pfx) - len(patchname) - 2
@@ -2012,7 +2038,7 b' def refresh(ui, repo, *pats, **opts):'
2012 if message:
2038 if message:
2013 raise util.Abort(_('option "-e" incompatible with "-m" or "-l"'))
2039 raise util.Abort(_('option "-e" incompatible with "-m" or "-l"'))
2014 patch = q.applied[-1].name
2040 patch = q.applied[-1].name
2015 ph = patchheader(q.join(patch))
2041 ph = patchheader(q.join(patch), q.plainmode)
2016 message = ui.edit('\n'.join(ph.message), ph.user or ui.username())
2042 message = ui.edit('\n'.join(ph.message), ph.user or ui.username())
2017 setupheaderopts(ui, opts)
2043 setupheaderopts(ui, opts)
2018 ret = q.refresh(repo, pats, msg=message, **opts)
2044 ret = q.refresh(repo, pats, msg=message, **opts)
@@ -2074,7 +2100,7 b' def fold(ui, repo, *files, **opts):'
2074
2100
2075 for p in patches:
2101 for p in patches:
2076 if not message:
2102 if not message:
2077 ph = patchheader(q.join(p))
2103 ph = patchheader(q.join(p), q.plainmode)
2078 if ph.message:
2104 if ph.message:
2079 messages.append(ph.message)
2105 messages.append(ph.message)
2080 pf = q.join(p)
2106 pf = q.join(p)
@@ -2084,7 +2110,7 b' def fold(ui, repo, *files, **opts):'
2084 patch.updatedir(ui, repo, files)
2110 patch.updatedir(ui, repo, files)
2085
2111
2086 if not message:
2112 if not message:
2087 ph = patchheader(q.join(parent))
2113 ph = patchheader(q.join(parent), q.plainmode)
2088 message, user = ph.message, ph.user
2114 message, user = ph.message, ph.user
2089 for msg in messages:
2115 for msg in messages:
2090 message.append('* * *')
2116 message.append('* * *')
@@ -2167,7 +2193,7 b' def header(ui, repo, patch=None):'
2167 ui.write('no patches applied\n')
2193 ui.write('no patches applied\n')
2168 return 1
2194 return 1
2169 patch = q.lookup('qtip')
2195 patch = q.lookup('qtip')
2170 ph = patchheader(repo.mq.join(patch))
2196 ph = patchheader(q.join(patch), q.plainmode)
2171
2197
2172 ui.write('\n'.join(ph.message) + '\n')
2198 ui.write('\n'.join(ph.message) + '\n')
2173
2199
@@ -10,6 +10,9 b' checkundo()'
10 echo "[extensions]" >> $HGRCPATH
10 echo "[extensions]" >> $HGRCPATH
11 echo "mq=" >> $HGRCPATH
11 echo "mq=" >> $HGRCPATH
12
12
13 echo "[mq]" >> $HGRCPATH
14 echo "plain=true" >> $HGRCPATH
15
13 echo % help
16 echo % help
14 hg help mq
17 hg help mq
15
18
@@ -25,7 +25,7 b' hg add regular'
25 hg qnew -d '0 0' --git -f git
25 hg qnew -d '0 0' --git -f git
26 cat .hg/patches/git
26 cat .hg/patches/git
27 echo '% git=auto: regular patch after qrefresh without --git'
27 echo '% git=auto: regular patch after qrefresh without --git'
28 hg qrefresh -d '0 0'
28 hg qrefresh -d '0 0'
29 cat .hg/patches/git
29 cat .hg/patches/git
30 cd ..
30 cd ..
31
31
@@ -1,5 +1,6 b''
1 % git=auto: regular patch creation
1 % git=auto: regular patch creation
2 # HG changeset patch
2 # HG changeset patch
3 # Parent 0000000000000000000000000000000000000000
3 # Date 0 0
4 # Date 0 0
4
5
5 diff -r 000000000000 -r ef8dafc9fa4c a
6 diff -r 000000000000 -r ef8dafc9fa4c a
@@ -9,6 +10,7 b' diff -r 000000000000 -r ef8dafc9fa4c a'
9 +a
10 +a
10 % git=auto: git patch creation with copy
11 % git=auto: git patch creation with copy
11 # HG changeset patch
12 # HG changeset patch
13 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
12 # Date 0 0
14 # Date 0 0
13
15
14 diff --git a/a b/b
16 diff --git a/a b/b
@@ -16,6 +18,7 b' copy from a'
16 copy to b
18 copy to b
17 % git=auto: git patch when using --git
19 % git=auto: git patch when using --git
18 # HG changeset patch
20 # HG changeset patch
21 # Parent 2962f232b49d41ebc26c591ec8d556724be213ab
19 # Date 0 0
22 # Date 0 0
20
23
21 diff --git a/regular b/regular
24 diff --git a/regular b/regular
@@ -26,6 +29,7 b' new file mode 100644'
26 +regular
29 +regular
27 % git=auto: regular patch after qrefresh without --git
30 % git=auto: regular patch after qrefresh without --git
28 # HG changeset patch
31 # HG changeset patch
32 # Parent 2962f232b49d41ebc26c591ec8d556724be213ab
29 # Date 0 0
33 # Date 0 0
30
34
31 diff -r 2962f232b49d regular
35 diff -r 2962f232b49d regular
@@ -35,6 +39,7 b' diff -r 2962f232b49d regular'
35 +regular
39 +regular
36 % git=keep: git patch with --git
40 % git=keep: git patch with --git
37 # HG changeset patch
41 # HG changeset patch
42 # Parent 0000000000000000000000000000000000000000
38 # Date 0 0
43 # Date 0 0
39
44
40 diff --git a/a b/a
45 diff --git a/a b/a
@@ -45,6 +50,7 b' new file mode 100644'
45 +a
50 +a
46 % git=keep: git patch after qrefresh without --git
51 % git=keep: git patch after qrefresh without --git
47 # HG changeset patch
52 # HG changeset patch
53 # Parent 0000000000000000000000000000000000000000
48 # Date 0 0
54 # Date 0 0
49
55
50 diff --git a/a b/a
56 diff --git a/a b/a
@@ -56,6 +62,7 b' new file mode 100644'
56 +a
62 +a
57 % git=yes: git patch
63 % git=yes: git patch
58 # HG changeset patch
64 # HG changeset patch
65 # Parent 0000000000000000000000000000000000000000
59 # Date 0 0
66 # Date 0 0
60
67
61 diff --git a/a b/a
68 diff --git a/a b/a
@@ -66,6 +73,7 b' new file mode 100644'
66 +a
73 +a
67 % git=yes: git patch after qrefresh
74 % git=yes: git patch after qrefresh
68 # HG changeset patch
75 # HG changeset patch
76 # Parent 0000000000000000000000000000000000000000
69 # Date 0 0
77 # Date 0 0
70
78
71 diff --git a/a b/a
79 diff --git a/a b/a
@@ -77,6 +85,7 b' new file mode 100644'
77 +a
85 +a
78 % git=no: regular patch with copy
86 % git=no: regular patch with copy
79 # HG changeset patch
87 # HG changeset patch
88 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
80 # Date 0 0
89 # Date 0 0
81
90
82 diff -r ef8dafc9fa4c -r 110cde11d262 b
91 diff -r ef8dafc9fa4c -r 110cde11d262 b
@@ -86,6 +95,7 b' diff -r ef8dafc9fa4c -r 110cde11d262 b'
86 +a
95 +a
87 % git=no: regular patch after qrefresh with copy
96 % git=no: regular patch after qrefresh with copy
88 # HG changeset patch
97 # HG changeset patch
98 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
89 # Date 0 0
99 # Date 0 0
90
100
91 diff -r ef8dafc9fa4c b
101 diff -r ef8dafc9fa4c b
@@ -7,7 +7,8 b' echo "nodates=true" >> $HGRCPATH'
7
7
8
8
9 catpatch() {
9 catpatch() {
10 cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /"
10 cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
11 -e "s/^\(# Parent \).*/\1/"
11 }
12 }
12
13
13 catlog() {
14 catlog() {
@@ -25,153 +26,192 b' drop() {'
25 hg qdel $1.patch
26 hg qdel $1.patch
26 }
27 }
27
28
28
29 runtest() {
29 echo ==== init
30 echo ==== init
30 hg init a
31 hg init a
31 cd a
32 cd a
32 hg qinit
33 hg qinit
33
34
34
35
35 echo ==== qnew -d
36 echo ==== qnew -d
36 hg qnew -d '3 0' 1.patch
37 hg qnew -d '3 0' 1.patch
37 catlogd 1
38 catlogd 1
38
39
39 echo ==== qref
40 echo ==== qref
40 echo "1" >1
41 echo "1" >1
41 hg add
42 hg add
42 hg qref
43 hg qref
43 catlogd 1
44 catlogd 1
44
45
45 echo ==== qref -d
46 echo ==== qref -d
46 hg qref -d '4 0'
47 hg qref -d '4 0'
47 catlogd 1
48 catlogd 1
48
49
49
50
50 echo ==== qnew
51 echo ==== qnew
51 hg qnew 2.patch
52 hg qnew 2.patch
52 echo "2" >2
53 echo "2" >2
53 hg add
54 hg add
54 hg qref
55 hg qref
55 catlog 2
56 catlog 2
56
57
57 echo ==== qref -d
58 echo ==== qref -d
58 hg qref -d '5 0'
59 hg qref -d '5 0'
59 catlog 2
60 catlog 2
60
61
61 drop 2
62 drop 2
62
63
63
64
64 echo ==== qnew -d -m
65 echo ==== qnew -d -m
65 hg qnew -d '6 0' -m "Three" 3.patch
66 hg qnew -d '6 0' -m "Three" 3.patch
66 catlogd 3
67 catlogd 3
67
68
68 echo ==== qref
69 echo ==== qref
69 echo "3" >3
70 echo "3" >3
70 hg add
71 hg add
71 hg qref
72 hg qref
72 catlogd 3
73 catlogd 3
73
74
74 echo ==== qref -m
75 echo ==== qref -m
75 hg qref -m "Drei"
76 hg qref -m "Drei"
76 catlogd 3
77 catlogd 3
77
78
78 echo ==== qref -d
79 echo ==== qref -d
79 hg qref -d '7 0'
80 hg qref -d '7 0'
80 catlogd 3
81 catlogd 3
81
82
82 echo ==== qref -d -m
83 echo ==== qref -d -m
83 hg qref -d '8 0' -m "Three (again)"
84 hg qref -d '8 0' -m "Three (again)"
84 catlogd 3
85 catlogd 3
85
86
86
87
87 echo ==== qnew -m
88 echo ==== qnew -m
88 hg qnew -m "Four" 4.patch
89 hg qnew -m "Four" 4.patch
89 echo "4" >4
90 echo "4" >4
90 hg add
91 hg add
91 hg qref
92 hg qref
92 catlog 4
93 catlog 4
94
95 echo ==== qref -d
96 hg qref -d '9 0'
97 catlog 4
98
99 drop 4
100
93
101
94 echo ==== qref -d
102 echo ==== qnew with HG header
95 hg qref -d '9 0'
103 hg qnew --config 'mq.plain=true' 5.patch
96 catlog 4
104 hg qpop
105 echo "# HG changeset patch" >>.hg/patches/5.patch
106 echo "# Date 10 0" >>.hg/patches/5.patch
107 hg qpush 2>&1 | grep 'Now at'
108 catlogd 5
97
109
98 drop 4
110 echo ==== hg qref
111 echo "5" >5
112 hg add
113 hg qref
114 catlogd 5
115
116 echo ==== hg qref -d
117 hg qref -d '11 0'
118 catlogd 5
99
119
100
120
101 echo ==== qnew with HG header
121 echo ==== qnew with plain header
102 hg qnew 5.patch
122 hg qnew --config 'mq.plain=true' -d '12 0' 6.patch
103 hg qpop
123 hg qpop
104 echo "# HG changeset patch" >>.hg/patches/5.patch
124 hg qpush 2>&1 | grep 'now at'
105 echo "# Date 10 0" >>.hg/patches/5.patch
125 catlog 6
106 hg qpush 2>&1 | grep 'Now at'
126
107 catlogd 5
127 echo ==== hg qref
128 echo "6" >6
129 hg add
130 hg qref
131 catlogd 6
132
133 echo ==== hg qref -d
134 hg qref -d '13 0'
135 catlogd 6
108
136
109 echo ==== hg qref
137 drop 6
110 echo "5" >5
138
111 hg add
112 hg qref
113 catlogd 5
114
139
115 echo ==== hg qref -d
140 echo ==== qnew -u
116 hg qref -d '11 0'
141 hg qnew -u jane 6.patch
117 catlogd 5
142 echo "6" >6
143 hg add
144 hg qref
145 catlog 6
146
147 echo ==== qref -d
148 hg qref -d '12 0'
149 catlog 6
150
151 drop 6
118
152
119
153
120 echo ==== qnew -u
154 echo ==== qnew -d
121 hg qnew -u jane 6.patch
155 hg qnew -d '13 0' 7.patch
122 echo "6" >6
156 echo "7" >7
123 hg add
157 hg add
124 hg qref
158 hg qref
125 catlog 6
159 catlog 7
126
160
127 echo ==== qref -d
161 echo ==== qref -u
128 hg qref -d '12 0'
162 hg qref -u john
129 catlog 6
163 catlogd 7
130
131 drop 6
132
164
133
165
134 echo ==== qnew -d
166 echo ==== qnew
135 hg qnew -d '13 0' 7.patch
167 hg qnew 8.patch
136 echo "7" >7
168 echo "8" >8
137 hg add
169 hg add
138 hg qref
170 hg qref
139 catlog 7
171 catlog 8
140
172
141 echo ==== qref -u
173 echo ==== qref -u -d
142 hg qref -u john
174 hg qref -u john -d '14 0'
143 catlogd 7
175 catlog 8
176
177 drop 8
144
178
145
179
146 echo ==== qnew
180 echo ==== qnew -m
147 hg qnew 8.patch
181 hg qnew -m "Nine" 9.patch
148 echo "8" >8
182 echo "9" >9
149 hg add
183 hg add
150 hg qref
184 hg qref
151 catlog 8
185 catlog 9
152
186
153 echo ==== qref -u -d
187 echo ==== qref -u -d
154 hg qref -u john -d '14 0'
188 hg qref -u john -d '15 0'
155 catlog 8
189 catlog 9
156
190
157 drop 8
191 drop 9
158
192
159
193
160 echo ==== qnew -m
194 echo ==== "qpop -a / qpush -a"
161 hg qnew -m "Nine" 9.patch
195 hg qpop -a
162 echo "9" >9
196 hg qpush -a
163 hg add
197 hg log --template "{rev}: {desc} - {author} - {date}\n"
164 hg qref
198 }
165 catlog 9
166
167 echo ==== qref -u -d
168 hg qref -u john -d '15 0'
169 catlog 9
170
171 drop 9
172
199
173
200
174 echo ==== "qpop -a / qpush -a"
201 echo ======= plain headers
175 hg qpop -a
202
176 hg qpush -a
203 echo "[mq]" >> $HGRCPATH
177 hg log --template "{rev}: {desc} - {author} - {date}\n"
204 echo "plain=true" >> $HGRCPATH
205
206 mkdir sandbox
207 (cd sandbox ; runtest)
208 rm -r sandbox
209
210
211 echo ======= hg headers
212
213 echo "plain=false" >> $HGRCPATH
214
215 mkdir sandbox
216 (cd sandbox ; runtest)
217 rm -r sandbox
@@ -1,13 +1,12 b''
1 ======= plain headers
1 ==== init
2 ==== init
2 ==== qnew -d
3 ==== qnew -d
3 # HG changeset patch
4 Date: 3 0
4 # Date 3 0
5
5
6 0: [mq]: 1.patch - test - 3.00
6 0: [mq]: 1.patch - test - 3.00
7 ==== qref
7 ==== qref
8 adding 1
8 adding 1
9 # HG changeset patch
9 Date: 3 0
10 # Date 3 0
11
10
12 diff -r ... 1
11 diff -r ... 1
13 --- /dev/null
12 --- /dev/null
@@ -16,8 +15,7 b' diff -r ... 1'
16 +1
15 +1
17 0: [mq]: 1.patch - test - 3.00
16 0: [mq]: 1.patch - test - 3.00
18 ==== qref -d
17 ==== qref -d
19 # HG changeset patch
18 Date: 4 0
20 # Date 4 0
21
19
22 diff -r ... 1
20 diff -r ... 1
23 --- /dev/null
21 --- /dev/null
@@ -35,9 +33,7 b' diff -r ... 2'
35 1: [mq]: 2.patch - test
33 1: [mq]: 2.patch - test
36 0: [mq]: 1.patch - test
34 0: [mq]: 1.patch - test
37 ==== qref -d
35 ==== qref -d
38 # HG changeset patch
36 Date: 5 0
39 # Date 5 0
40
41
37
42 diff -r ... 2
38 diff -r ... 2
43 --- /dev/null
39 --- /dev/null
@@ -49,8 +45,7 b' 0: [mq]: 1.patch - test'
49 popping 2.patch
45 popping 2.patch
50 now at: 1.patch
46 now at: 1.patch
51 ==== qnew -d -m
47 ==== qnew -d -m
52 # HG changeset patch
48 Date: 6 0
53 # Date 6 0
54
49
55 Three
50 Three
56
51
@@ -58,8 +53,7 b' 1: Three - test - 6.00'
58 0: [mq]: 1.patch - test - 4.00
53 0: [mq]: 1.patch - test - 4.00
59 ==== qref
54 ==== qref
60 adding 3
55 adding 3
61 # HG changeset patch
56 Date: 6 0
62 # Date 6 0
63
57
64 Three
58 Three
65
59
@@ -71,8 +65,7 b' diff -r ... 3'
71 1: Three - test - 6.00
65 1: Three - test - 6.00
72 0: [mq]: 1.patch - test - 4.00
66 0: [mq]: 1.patch - test - 4.00
73 ==== qref -m
67 ==== qref -m
74 # HG changeset patch
68 Date: 6 0
75 # Date 6 0
76
69
77 Drei
70 Drei
78
71
@@ -84,8 +77,7 b' diff -r ... 3'
84 1: Drei - test - 6.00
77 1: Drei - test - 6.00
85 0: [mq]: 1.patch - test - 4.00
78 0: [mq]: 1.patch - test - 4.00
86 ==== qref -d
79 ==== qref -d
87 # HG changeset patch
80 Date: 7 0
88 # Date 7 0
89
81
90 Drei
82 Drei
91
83
@@ -97,8 +89,7 b' diff -r ... 3'
97 1: Drei - test - 7.00
89 1: Drei - test - 7.00
98 0: [mq]: 1.patch - test - 4.00
90 0: [mq]: 1.patch - test - 4.00
99 ==== qref -d -m
91 ==== qref -d -m
100 # HG changeset patch
92 Date: 8 0
101 # Date 8 0
102
93
103 Three (again)
94 Three (again)
104
95
@@ -122,9 +113,7 b' 2: Four - test'
122 1: Three (again) - test
113 1: Three (again) - test
123 0: [mq]: 1.patch - test
114 0: [mq]: 1.patch - test
124 ==== qref -d
115 ==== qref -d
125 # HG changeset patch
116 Date: 9 0
126 # Date 9 0
127
128 Four
117 Four
129
118
130 diff -r ... 4
119 diff -r ... 4
@@ -148,6 +137,7 b' 0: [mq]: 1.patch - test - 4.00'
148 ==== hg qref
137 ==== hg qref
149 adding 5
138 adding 5
150 # HG changeset patch
139 # HG changeset patch
140 # Parent
151 # Date 10 0
141 # Date 10 0
152
142
153 diff -r ... 5
143 diff -r ... 5
@@ -160,6 +150,7 b' 1: Three (again) - test - 8.00'
160 0: [mq]: 1.patch - test - 4.00
150 0: [mq]: 1.patch - test - 4.00
161 ==== hg qref -d
151 ==== hg qref -d
162 # HG changeset patch
152 # HG changeset patch
153 # Parent
163 # Date 11 0
154 # Date 11 0
164
155
165 diff -r ... 5
156 diff -r ... 5
@@ -170,6 +161,43 b' diff -r ... 5'
170 2: [mq]: 5.patch - test - 11.00
161 2: [mq]: 5.patch - test - 11.00
171 1: Three (again) - test - 8.00
162 1: Three (again) - test - 8.00
172 0: [mq]: 1.patch - test - 4.00
163 0: [mq]: 1.patch - test - 4.00
164 ==== qnew with plain header
165 popping 6.patch
166 now at: 5.patch
167 now at: 6.patch
168 Date: 12 0
169
170 3: imported patch 6.patch - test
171 2: [mq]: 5.patch - test
172 1: Three (again) - test
173 0: [mq]: 1.patch - test
174 ==== hg qref
175 adding 6
176 Date: 12 0
177
178 diff -r ... 6
179 --- /dev/null
180 +++ b/6
181 @@ -0,0 +1,1 @@
182 +6
183 3: [mq]: 6.patch - test - 12.00
184 2: [mq]: 5.patch - test - 11.00
185 1: Three (again) - test - 8.00
186 0: [mq]: 1.patch - test - 4.00
187 ==== hg qref -d
188 Date: 13 0
189
190 diff -r ... 6
191 --- /dev/null
192 +++ b/6
193 @@ -0,0 +1,1 @@
194 +6
195 3: [mq]: 6.patch - test - 13.00
196 2: [mq]: 5.patch - test - 11.00
197 1: Three (again) - test - 8.00
198 0: [mq]: 1.patch - test - 4.00
199 popping 6.patch
200 now at: 5.patch
173 ==== qnew -u
201 ==== qnew -u
174 adding 6
202 adding 6
175 From: jane
203 From: jane
@@ -200,8 +228,7 b' popping 6.patch'
200 now at: 5.patch
228 now at: 5.patch
201 ==== qnew -d
229 ==== qnew -d
202 adding 7
230 adding 7
203 # HG changeset patch
231 Date: 13 0
204 # Date 13 0
205
232
206 diff -r ... 7
233 diff -r ... 7
207 --- /dev/null
234 --- /dev/null
@@ -213,9 +240,8 b' 2: [mq]: 5.patch - test'
213 1: Three (again) - test
240 1: Three (again) - test
214 0: [mq]: 1.patch - test
241 0: [mq]: 1.patch - test
215 ==== qref -u
242 ==== qref -u
216 # HG changeset patch
243 From: john
217 # User john
244 Date: 13 0
218 # Date 13 0
219
245
220 diff -r ... 7
246 diff -r ... 7
221 --- /dev/null
247 --- /dev/null
@@ -239,10 +265,8 b' 2: [mq]: 5.patch - test'
239 1: Three (again) - test
265 1: Three (again) - test
240 0: [mq]: 1.patch - test
266 0: [mq]: 1.patch - test
241 ==== qref -u -d
267 ==== qref -u -d
242 # HG changeset patch
268 Date: 14 0
243 # Date 14 0
269 From: john
244 # User john
245
246
270
247 diff -r ... 8
271 diff -r ... 8
248 --- /dev/null
272 --- /dev/null
@@ -271,10 +295,8 b' 2: [mq]: 5.patch - test'
271 1: Three (again) - test
295 1: Three (again) - test
272 0: [mq]: 1.patch - test
296 0: [mq]: 1.patch - test
273 ==== qref -u -d
297 ==== qref -u -d
274 # HG changeset patch
298 Date: 15 0
275 # Date 15 0
299 From: john
276 # User john
277
278 Nine
300 Nine
279
301
280 diff -r ... 9
302 diff -r ... 9
@@ -304,3 +326,373 b' 3: imported patch 7.patch - john - 13.00'
304 2: imported patch 5.patch - test - 11.00
326 2: imported patch 5.patch - test - 11.00
305 1: Three (again) - test - 8.00
327 1: Three (again) - test - 8.00
306 0: imported patch 1.patch - test - 4.00
328 0: imported patch 1.patch - test - 4.00
329 ======= hg headers
330 ==== init
331 ==== qnew -d
332 # HG changeset patch
333 # Parent
334 # Date 3 0
335
336 0: [mq]: 1.patch - test - 3.00
337 ==== qref
338 adding 1
339 # HG changeset patch
340 # Parent
341 # Date 3 0
342
343 diff -r ... 1
344 --- /dev/null
345 +++ b/1
346 @@ -0,0 +1,1 @@
347 +1
348 0: [mq]: 1.patch - test - 3.00
349 ==== qref -d
350 # HG changeset patch
351 # Parent
352 # Date 4 0
353
354 diff -r ... 1
355 --- /dev/null
356 +++ b/1
357 @@ -0,0 +1,1 @@
358 +1
359 0: [mq]: 1.patch - test - 4.00
360 ==== qnew
361 adding 2
362 # HG changeset patch
363 # Parent
364
365 diff -r ... 2
366 --- /dev/null
367 +++ b/2
368 @@ -0,0 +1,1 @@
369 +2
370 1: [mq]: 2.patch - test
371 0: [mq]: 1.patch - test
372 ==== qref -d
373 # HG changeset patch
374 # Date 5 0
375 # Parent
376
377 diff -r ... 2
378 --- /dev/null
379 +++ b/2
380 @@ -0,0 +1,1 @@
381 +2
382 1: [mq]: 2.patch - test
383 0: [mq]: 1.patch - test
384 popping 2.patch
385 now at: 1.patch
386 ==== qnew -d -m
387 # HG changeset patch
388 # Parent
389 # Date 6 0
390
391 Three
392
393 1: Three - test - 6.00
394 0: [mq]: 1.patch - test - 4.00
395 ==== qref
396 adding 3
397 # HG changeset patch
398 # Parent
399 # Date 6 0
400
401 Three
402
403 diff -r ... 3
404 --- /dev/null
405 +++ b/3
406 @@ -0,0 +1,1 @@
407 +3
408 1: Three - test - 6.00
409 0: [mq]: 1.patch - test - 4.00
410 ==== qref -m
411 # HG changeset patch
412 # Parent
413 # Date 6 0
414
415 Drei
416
417 diff -r ... 3
418 --- /dev/null
419 +++ b/3
420 @@ -0,0 +1,1 @@
421 +3
422 1: Drei - test - 6.00
423 0: [mq]: 1.patch - test - 4.00
424 ==== qref -d
425 # HG changeset patch
426 # Parent
427 # Date 7 0
428
429 Drei
430
431 diff -r ... 3
432 --- /dev/null
433 +++ b/3
434 @@ -0,0 +1,1 @@
435 +3
436 1: Drei - test - 7.00
437 0: [mq]: 1.patch - test - 4.00
438 ==== qref -d -m
439 # HG changeset patch
440 # Parent
441 # Date 8 0
442
443 Three (again)
444
445 diff -r ... 3
446 --- /dev/null
447 +++ b/3
448 @@ -0,0 +1,1 @@
449 +3
450 1: Three (again) - test - 8.00
451 0: [mq]: 1.patch - test - 4.00
452 ==== qnew -m
453 adding 4
454 # HG changeset patch
455 # Parent
456 Four
457
458 diff -r ... 4
459 --- /dev/null
460 +++ b/4
461 @@ -0,0 +1,1 @@
462 +4
463 2: Four - test
464 1: Three (again) - test
465 0: [mq]: 1.patch - test
466 ==== qref -d
467 # HG changeset patch
468 # Date 9 0
469 # Parent
470 Four
471
472 diff -r ... 4
473 --- /dev/null
474 +++ b/4
475 @@ -0,0 +1,1 @@
476 +4
477 2: Four - test
478 1: Three (again) - test
479 0: [mq]: 1.patch - test
480 popping 4.patch
481 now at: 3.patch
482 ==== qnew with HG header
483 popping 5.patch
484 now at: 3.patch
485 # HG changeset patch
486 # Date 10 0
487 2: imported patch 5.patch - test - 10.00
488 1: Three (again) - test - 8.00
489 0: [mq]: 1.patch - test - 4.00
490 ==== hg qref
491 adding 5
492 # HG changeset patch
493 # Parent
494 # Date 10 0
495
496 diff -r ... 5
497 --- /dev/null
498 +++ b/5
499 @@ -0,0 +1,1 @@
500 +5
501 2: [mq]: 5.patch - test - 10.00
502 1: Three (again) - test - 8.00
503 0: [mq]: 1.patch - test - 4.00
504 ==== hg qref -d
505 # HG changeset patch
506 # Parent
507 # Date 11 0
508
509 diff -r ... 5
510 --- /dev/null
511 +++ b/5
512 @@ -0,0 +1,1 @@
513 +5
514 2: [mq]: 5.patch - test - 11.00
515 1: Three (again) - test - 8.00
516 0: [mq]: 1.patch - test - 4.00
517 ==== qnew with plain header
518 popping 6.patch
519 now at: 5.patch
520 now at: 6.patch
521 Date: 12 0
522
523 3: imported patch 6.patch - test
524 2: [mq]: 5.patch - test
525 1: Three (again) - test
526 0: [mq]: 1.patch - test
527 ==== hg qref
528 adding 6
529 Date: 12 0
530
531 diff -r ... 6
532 --- /dev/null
533 +++ b/6
534 @@ -0,0 +1,1 @@
535 +6
536 3: [mq]: 6.patch - test - 12.00
537 2: [mq]: 5.patch - test - 11.00
538 1: Three (again) - test - 8.00
539 0: [mq]: 1.patch - test - 4.00
540 ==== hg qref -d
541 Date: 13 0
542
543 diff -r ... 6
544 --- /dev/null
545 +++ b/6
546 @@ -0,0 +1,1 @@
547 +6
548 3: [mq]: 6.patch - test - 13.00
549 2: [mq]: 5.patch - test - 11.00
550 1: Three (again) - test - 8.00
551 0: [mq]: 1.patch - test - 4.00
552 popping 6.patch
553 now at: 5.patch
554 ==== qnew -u
555 adding 6
556 # HG changeset patch
557 # Parent
558 # User jane
559
560 diff -r ... 6
561 --- /dev/null
562 +++ b/6
563 @@ -0,0 +1,1 @@
564 +6
565 3: [mq]: 6.patch - jane
566 2: [mq]: 5.patch - test
567 1: Three (again) - test
568 0: [mq]: 1.patch - test
569 ==== qref -d
570 # HG changeset patch
571 # Date 12 0
572 # Parent
573 # User jane
574
575 diff -r ... 6
576 --- /dev/null
577 +++ b/6
578 @@ -0,0 +1,1 @@
579 +6
580 3: [mq]: 6.patch - jane
581 2: [mq]: 5.patch - test
582 1: Three (again) - test
583 0: [mq]: 1.patch - test
584 popping 6.patch
585 now at: 5.patch
586 ==== qnew -d
587 adding 7
588 # HG changeset patch
589 # Parent
590 # Date 13 0
591
592 diff -r ... 7
593 --- /dev/null
594 +++ b/7
595 @@ -0,0 +1,1 @@
596 +7
597 3: [mq]: 7.patch - test
598 2: [mq]: 5.patch - test
599 1: Three (again) - test
600 0: [mq]: 1.patch - test
601 ==== qref -u
602 # HG changeset patch
603 # User john
604 # Parent
605 # Date 13 0
606
607 diff -r ... 7
608 --- /dev/null
609 +++ b/7
610 @@ -0,0 +1,1 @@
611 +7
612 3: [mq]: 7.patch - john - 13.00
613 2: [mq]: 5.patch - test - 11.00
614 1: Three (again) - test - 8.00
615 0: [mq]: 1.patch - test - 4.00
616 ==== qnew
617 adding 8
618 # HG changeset patch
619 # Parent
620
621 diff -r ... 8
622 --- /dev/null
623 +++ b/8
624 @@ -0,0 +1,1 @@
625 +8
626 4: [mq]: 8.patch - test
627 3: [mq]: 7.patch - john
628 2: [mq]: 5.patch - test
629 1: Three (again) - test
630 0: [mq]: 1.patch - test
631 ==== qref -u -d
632 # HG changeset patch
633 # Date 14 0
634 # User john
635 # Parent
636
637 diff -r ... 8
638 --- /dev/null
639 +++ b/8
640 @@ -0,0 +1,1 @@
641 +8
642 4: [mq]: 8.patch - john
643 3: [mq]: 7.patch - john
644 2: [mq]: 5.patch - test
645 1: Three (again) - test
646 0: [mq]: 1.patch - test
647 popping 8.patch
648 now at: 7.patch
649 ==== qnew -m
650 adding 9
651 # HG changeset patch
652 # Parent
653 Nine
654
655 diff -r ... 9
656 --- /dev/null
657 +++ b/9
658 @@ -0,0 +1,1 @@
659 +9
660 4: Nine - test
661 3: [mq]: 7.patch - john
662 2: [mq]: 5.patch - test
663 1: Three (again) - test
664 0: [mq]: 1.patch - test
665 ==== qref -u -d
666 # HG changeset patch
667 # Date 15 0
668 # User john
669 # Parent
670 Nine
671
672 diff -r ... 9
673 --- /dev/null
674 +++ b/9
675 @@ -0,0 +1,1 @@
676 +9
677 4: Nine - john
678 3: [mq]: 7.patch - john
679 2: [mq]: 5.patch - test
680 1: Three (again) - test
681 0: [mq]: 1.patch - test
682 popping 9.patch
683 now at: 7.patch
684 ==== qpop -a / qpush -a
685 popping 7.patch
686 popping 5.patch
687 popping 3.patch
688 popping 1.patch
689 patch queue now empty
690 applying 1.patch
691 applying 3.patch
692 applying 5.patch
693 applying 7.patch
694 now at: 7.patch
695 3: imported patch 7.patch - john - 13.00
696 2: imported patch 5.patch - test - 11.00
697 1: Three (again) - test - 8.00
698 0: imported patch 1.patch - test - 4.00
@@ -7,101 +7,145 b' echo "nodates=true" >> $HGRCPATH'
7
7
8
8
9 catlog() {
9 catlog() {
10 cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /"
10 cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
11 -e "s/^\(# Parent \).*/\1/"
12 hg log --template "{rev}: {desc} - {author}\n"
13 }
14
15 runtest() {
16 echo ==== init
17 hg init a
18 cd a
19 hg qinit
20
21
22 echo ==== qnew -U
23 hg qnew -U 1.patch
24 catlog 1
25
26 echo ==== qref
27 echo "1" >1
28 hg add
29 hg qref
30 catlog 1
31
32 echo ==== qref -u
33 hg qref -u mary
34 catlog 1
35
36 echo ==== qnew
37 hg qnew 2.patch
38 echo "2" >2
39 hg add
40 hg qref
41 catlog 2
42
43 echo ==== qref -u
44 hg qref -u jane
45 catlog 2
46
47
48 echo ==== qnew -U -m
49 hg qnew -U -m "Three" 3.patch
50 catlog 3
51
52 echo ==== qref
53 echo "3" >3
54 hg add
55 hg qref
56 catlog 3
57
58 echo ==== qref -m
59 hg qref -m "Drei"
60 catlog 3
61
62 echo ==== qref -u
63 hg qref -u mary
64 catlog 3
65
66 echo ==== qref -u -m
67 hg qref -u maria -m "Three (again)"
68 catlog 3
69
70 echo ==== qnew -m
71 hg qnew -m "Four" 4.patch
72 echo "4" >4of t
73 hg add
74 hg qref
75 catlog 4
76
77 echo ==== qref -u
78 hg qref -u jane
79 catlog 4
80
81
82 echo ==== qnew with HG header
83 hg qnew --config 'mq.plain=true' 5.patch
84 hg qpop
85 echo "# HG changeset patch" >>.hg/patches/5.patch
86 echo "# User johndoe" >>.hg/patches/5.patch
87 hg qpush 2>&1 | grep 'now at'
88 catlog 5
89
90 echo ==== hg qref
91 echo "5" >5
92 hg add
93 hg qref
94 catlog 5
95
96 echo ==== hg qref -U
97 hg qref -U
98 catlog 5
99
100 echo ==== hg qref -u
101 hg qref -u johndeere
102 catlog 5
103
104
105 echo ==== qnew with plain header
106 hg qnew --config 'mq.plain=true' -U 6.patch
107 hg qpop
108 hg qpush 2>&1 | grep 'now at'
109 catlog 6
110
111 echo ==== hg qref
112 echo "6" >6
113 hg add
114 hg qref
115 catlog 6
116
117 echo ==== hg qref -U
118 hg qref -U
119 catlog 6
120
121 echo ==== hg qref -u
122 hg qref -u johndeere
123 catlog 6
124
125
126 echo ==== "qpop -a / qpush -a"
127 hg qpop -a
128 hg qpush -a
11 hg log --template "{rev}: {desc} - {author}\n"
129 hg log --template "{rev}: {desc} - {author}\n"
12 }
130 }
13
131
14
132
15 echo ==== init
133 echo ======= plain headers
16 hg init a
17 cd a
18 hg qinit
19
20
21 echo ==== qnew -U
22 hg qnew -U 1.patch
23 catlog 1
24
134
25 echo ==== qref
135 echo "[mq]" >> $HGRCPATH
26 echo "1" >1
136 echo "plain=true" >> $HGRCPATH
27 hg add
28 hg qref
29 catlog 1
30
31 echo ==== qref -u
32 hg qref -u mary
33 catlog 1
34
137
35 echo ==== qnew
138 mkdir sandbox
36 hg qnew 2.patch
139 (cd sandbox ; runtest)
37 echo "2" >2
140 rm -r sandbox
38 hg add
39 hg qref
40 catlog 2
41
42 echo ==== qref -u
43 hg qref -u jane
44 catlog 2
45
141
46
142
47 echo ==== qnew -U -m
143 echo ======= hg headers
48 hg qnew -U -m "Three" 3.patch
49 catlog 3
50
51 echo ==== qref
52 echo "3" >3
53 hg add
54 hg qref
55 catlog 3
56
57 echo ==== qref -m
58 hg qref -m "Drei"
59 catlog 3
60
144
61 echo ==== qref -u
145 echo "plain=false" >> $HGRCPATH
62 hg qref -u mary
63 catlog 3
64
65 echo ==== qref -u -m
66 hg qref -u maria -m "Three (again)"
67 catlog 3
68
69 echo ==== qnew -m
70 hg qnew -m "Four" 4.patch
71 echo "4" >4
72 hg add
73 hg qref
74 catlog 4
75
146
76 echo ==== qref -u
147 mkdir sandbox
77 hg qref -u jane
148 (cd sandbox ; runtest)
78 catlog 4
149 rm -r sandbox
79
80
81 echo ==== qnew with HG header
82 hg qnew 5.patch
83 hg qpop
84 echo "# HG changeset patch" >>.hg/patches/5.patch
85 echo "# User johndoe" >>.hg/patches/5.patch
86 hg qpush 2>&1 | grep 'now at'
87 catlog 5
88
150
89 echo ==== hg qref
151 runtest No newline at end of file
90 echo "5" >5
91 hg add
92 hg qref
93 catlog 5
94
95 echo ==== hg qref -U
96 hg qref -U
97 catlog 5
98
99 echo ==== hg qref -u
100 hg qref -u johndeere
101 catlog 5
102
103
104 echo ==== "qpop -a / qpush -a"
105 hg qpop -a
106 hg qpush -a
107 hg log --template "{rev}: {desc} - {author}\n"
This diff has been collapsed as it changes many lines, (647 lines changed) Show them Hide them
@@ -1,3 +1,4 b''
1 ======= plain headers
1 ==== init
2 ==== init
2 ==== qnew -U
3 ==== qnew -U
3 From: test
4 From: test
@@ -32,9 +33,7 b' diff -r ... 2'
32 1: [mq]: 2.patch - test
33 1: [mq]: 2.patch - test
33 0: [mq]: 1.patch - mary
34 0: [mq]: 1.patch - mary
34 ==== qref -u
35 ==== qref -u
35 # HG changeset patch
36 From: jane
36 # User jane
37
38
37
39 diff -r ... 2
38 diff -r ... 2
40 --- /dev/null
39 --- /dev/null
@@ -105,14 +104,295 b' 2: Three (again) - maria'
105 1: [mq]: 2.patch - jane
104 1: [mq]: 2.patch - jane
106 0: [mq]: 1.patch - mary
105 0: [mq]: 1.patch - mary
107 ==== qnew -m
106 ==== qnew -m
108 adding 4
107 adding 4of
108 Four
109
110 diff -r ... 4of
111 --- /dev/null
112 +++ b/4of
113 @@ -0,0 +1,1 @@
114 +4 t
115 3: Four - test
116 2: Three (again) - maria
117 1: [mq]: 2.patch - jane
118 0: [mq]: 1.patch - mary
119 ==== qref -u
120 From: jane
109 Four
121 Four
110
122
111 diff -r ... 4
123 diff -r ... 4of
124 --- /dev/null
125 +++ b/4of
126 @@ -0,0 +1,1 @@
127 +4 t
128 3: Four - jane
129 2: Three (again) - maria
130 1: [mq]: 2.patch - jane
131 0: [mq]: 1.patch - mary
132 ==== qnew with HG header
133 popping 5.patch
134 now at: 4.patch
135 now at: 5.patch
136 # HG changeset patch
137 # User johndoe
138 4: imported patch 5.patch - johndoe
139 3: Four - jane
140 2: Three (again) - maria
141 1: [mq]: 2.patch - jane
142 0: [mq]: 1.patch - mary
143 ==== hg qref
144 adding 5
145 # HG changeset patch
146 # Parent
147 # User johndoe
148
149 diff -r ... 5
150 --- /dev/null
151 +++ b/5
152 @@ -0,0 +1,1 @@
153 +5
154 4: [mq]: 5.patch - johndoe
155 3: Four - jane
156 2: Three (again) - maria
157 1: [mq]: 2.patch - jane
158 0: [mq]: 1.patch - mary
159 ==== hg qref -U
160 # HG changeset patch
161 # Parent
162 # User test
163
164 diff -r ... 5
165 --- /dev/null
166 +++ b/5
167 @@ -0,0 +1,1 @@
168 +5
169 4: [mq]: 5.patch - test
170 3: Four - jane
171 2: Three (again) - maria
172 1: [mq]: 2.patch - jane
173 0: [mq]: 1.patch - mary
174 ==== hg qref -u
175 # HG changeset patch
176 # Parent
177 # User johndeere
178
179 diff -r ... 5
180 --- /dev/null
181 +++ b/5
182 @@ -0,0 +1,1 @@
183 +5
184 4: [mq]: 5.patch - johndeere
185 3: Four - jane
186 2: Three (again) - maria
187 1: [mq]: 2.patch - jane
188 0: [mq]: 1.patch - mary
189 ==== qnew with plain header
190 popping 6.patch
191 now at: 5.patch
192 now at: 6.patch
193 From: test
194
195 5: imported patch 6.patch - test
196 4: [mq]: 5.patch - johndeere
197 3: Four - jane
198 2: Three (again) - maria
199 1: [mq]: 2.patch - jane
200 0: [mq]: 1.patch - mary
201 ==== hg qref
202 adding 6
203 From: test
204
205 diff -r ... 6
206 --- /dev/null
207 +++ b/6
208 @@ -0,0 +1,1 @@
209 +6
210 5: [mq]: 6.patch - test
211 4: [mq]: 5.patch - johndeere
212 3: Four - jane
213 2: Three (again) - maria
214 1: [mq]: 2.patch - jane
215 0: [mq]: 1.patch - mary
216 ==== hg qref -U
217 From: test
218
219 diff -r ... 6
220 --- /dev/null
221 +++ b/6
222 @@ -0,0 +1,1 @@
223 +6
224 5: [mq]: 6.patch - test
225 4: [mq]: 5.patch - johndeere
226 3: Four - jane
227 2: Three (again) - maria
228 1: [mq]: 2.patch - jane
229 0: [mq]: 1.patch - mary
230 ==== hg qref -u
231 From: johndeere
232
233 diff -r ... 6
112 --- /dev/null
234 --- /dev/null
113 +++ b/4
235 +++ b/6
236 @@ -0,0 +1,1 @@
237 +6
238 5: [mq]: 6.patch - johndeere
239 4: [mq]: 5.patch - johndeere
240 3: Four - jane
241 2: Three (again) - maria
242 1: [mq]: 2.patch - jane
243 0: [mq]: 1.patch - mary
244 ==== qpop -a / qpush -a
245 popping 6.patch
246 popping 5.patch
247 popping 4.patch
248 popping 3.patch
249 popping 2.patch
250 popping 1.patch
251 patch queue now empty
252 applying 1.patch
253 applying 2.patch
254 applying 3.patch
255 applying 4.patch
256 applying 5.patch
257 applying 6.patch
258 now at: 6.patch
259 5: imported patch 6.patch - johndeere
260 4: imported patch 5.patch - johndeere
261 3: Four - jane
262 2: Three (again) - maria
263 1: imported patch 2.patch - jane
264 0: imported patch 1.patch - mary
265 ======= hg headers
266 ==== init
267 ==== qnew -U
268 # HG changeset patch
269 # Parent
270 # User test
271 0: [mq]: 1.patch - test
272 ==== qref
273 adding 1
274 # HG changeset patch
275 # Parent
276 # User test
277
278 diff -r ... 1
279 --- /dev/null
280 +++ b/1
281 @@ -0,0 +1,1 @@
282 +1
283 0: [mq]: 1.patch - test
284 ==== qref -u
285 # HG changeset patch
286 # Parent
287 # User mary
288
289 diff -r ... 1
290 --- /dev/null
291 +++ b/1
292 @@ -0,0 +1,1 @@
293 +1
294 0: [mq]: 1.patch - mary
295 ==== qnew
296 adding 2
297 # HG changeset patch
298 # Parent
299
300 diff -r ... 2
301 --- /dev/null
302 +++ b/2
303 @@ -0,0 +1,1 @@
304 +2
305 1: [mq]: 2.patch - test
306 0: [mq]: 1.patch - mary
307 ==== qref -u
308 # HG changeset patch
309 # User jane
310 # Parent
311
312 diff -r ... 2
313 --- /dev/null
314 +++ b/2
114 @@ -0,0 +1,1 @@
315 @@ -0,0 +1,1 @@
115 +4
316 +2
317 1: [mq]: 2.patch - jane
318 0: [mq]: 1.patch - mary
319 ==== qnew -U -m
320 # HG changeset patch
321 # Parent
322 # User test
323 Three
324
325 2: Three - test
326 1: [mq]: 2.patch - jane
327 0: [mq]: 1.patch - mary
328 ==== qref
329 adding 3
330 # HG changeset patch
331 # Parent
332 # User test
333 Three
334
335 diff -r ... 3
336 --- /dev/null
337 +++ b/3
338 @@ -0,0 +1,1 @@
339 +3
340 2: Three - test
341 1: [mq]: 2.patch - jane
342 0: [mq]: 1.patch - mary
343 ==== qref -m
344 # HG changeset patch
345 # Parent
346 # User test
347 Drei
348
349 diff -r ... 3
350 --- /dev/null
351 +++ b/3
352 @@ -0,0 +1,1 @@
353 +3
354 2: Drei - test
355 1: [mq]: 2.patch - jane
356 0: [mq]: 1.patch - mary
357 ==== qref -u
358 # HG changeset patch
359 # Parent
360 # User mary
361 Drei
362
363 diff -r ... 3
364 --- /dev/null
365 +++ b/3
366 @@ -0,0 +1,1 @@
367 +3
368 2: Drei - mary
369 1: [mq]: 2.patch - jane
370 0: [mq]: 1.patch - mary
371 ==== qref -u -m
372 # HG changeset patch
373 # Parent
374 # User maria
375 Three (again)
376
377 diff -r ... 3
378 --- /dev/null
379 +++ b/3
380 @@ -0,0 +1,1 @@
381 +3
382 2: Three (again) - maria
383 1: [mq]: 2.patch - jane
384 0: [mq]: 1.patch - mary
385 ==== qnew -m
386 adding 4of
387 # HG changeset patch
388 # Parent
389 Four
390
391 diff -r ... 4of
392 --- /dev/null
393 +++ b/4of
394 @@ -0,0 +1,1 @@
395 +4 t
116 3: Four - test
396 3: Four - test
117 2: Three (again) - maria
397 2: Three (again) - maria
118 1: [mq]: 2.patch - jane
398 1: [mq]: 2.patch - jane
@@ -120,14 +400,14 b' 0: [mq]: 1.patch - mary'
120 ==== qref -u
400 ==== qref -u
121 # HG changeset patch
401 # HG changeset patch
122 # User jane
402 # User jane
123
403 # Parent
124 Four
404 Four
125
405
126 diff -r ... 4
406 diff -r ... 4of
127 --- /dev/null
407 --- /dev/null
128 +++ b/4
408 +++ b/4of
129 @@ -0,0 +1,1 @@
409 @@ -0,0 +1,1 @@
130 +4
410 +4 t
131 3: Four - jane
411 3: Four - jane
132 2: Three (again) - maria
412 2: Three (again) - maria
133 1: [mq]: 2.patch - jane
413 1: [mq]: 2.patch - jane
@@ -146,6 +426,7 b' 0: [mq]: 1.patch - mary'
146 ==== hg qref
426 ==== hg qref
147 adding 5
427 adding 5
148 # HG changeset patch
428 # HG changeset patch
429 # Parent
149 # User johndoe
430 # User johndoe
150
431
151 diff -r ... 5
432 diff -r ... 5
@@ -160,6 +441,7 b' 1: [mq]: 2.patch - jane'
160 0: [mq]: 1.patch - mary
441 0: [mq]: 1.patch - mary
161 ==== hg qref -U
442 ==== hg qref -U
162 # HG changeset patch
443 # HG changeset patch
444 # Parent
163 # User test
445 # User test
164
446
165 diff -r ... 5
447 diff -r ... 5
@@ -174,6 +456,7 b' 1: [mq]: 2.patch - jane'
174 0: [mq]: 1.patch - mary
456 0: [mq]: 1.patch - mary
175 ==== hg qref -u
457 ==== hg qref -u
176 # HG changeset patch
458 # HG changeset patch
459 # Parent
177 # User johndeere
460 # User johndeere
178
461
179 diff -r ... 5
462 diff -r ... 5
@@ -186,7 +469,63 b' 3: Four - jane'
186 2: Three (again) - maria
469 2: Three (again) - maria
187 1: [mq]: 2.patch - jane
470 1: [mq]: 2.patch - jane
188 0: [mq]: 1.patch - mary
471 0: [mq]: 1.patch - mary
472 ==== qnew with plain header
473 popping 6.patch
474 now at: 5.patch
475 now at: 6.patch
476 From: test
477
478 5: imported patch 6.patch - test
479 4: [mq]: 5.patch - johndeere
480 3: Four - jane
481 2: Three (again) - maria
482 1: [mq]: 2.patch - jane
483 0: [mq]: 1.patch - mary
484 ==== hg qref
485 adding 6
486 From: test
487
488 diff -r ... 6
489 --- /dev/null
490 +++ b/6
491 @@ -0,0 +1,1 @@
492 +6
493 5: [mq]: 6.patch - test
494 4: [mq]: 5.patch - johndeere
495 3: Four - jane
496 2: Three (again) - maria
497 1: [mq]: 2.patch - jane
498 0: [mq]: 1.patch - mary
499 ==== hg qref -U
500 From: test
501
502 diff -r ... 6
503 --- /dev/null
504 +++ b/6
505 @@ -0,0 +1,1 @@
506 +6
507 5: [mq]: 6.patch - test
508 4: [mq]: 5.patch - johndeere
509 3: Four - jane
510 2: Three (again) - maria
511 1: [mq]: 2.patch - jane
512 0: [mq]: 1.patch - mary
513 ==== hg qref -u
514 From: johndeere
515
516 diff -r ... 6
517 --- /dev/null
518 +++ b/6
519 @@ -0,0 +1,1 @@
520 +6
521 5: [mq]: 6.patch - johndeere
522 4: [mq]: 5.patch - johndeere
523 3: Four - jane
524 2: Three (again) - maria
525 1: [mq]: 2.patch - jane
526 0: [mq]: 1.patch - mary
189 ==== qpop -a / qpush -a
527 ==== qpop -a / qpush -a
528 popping 6.patch
190 popping 5.patch
529 popping 5.patch
191 popping 4.patch
530 popping 4.patch
192 popping 3.patch
531 popping 3.patch
@@ -198,9 +537,293 b' applying 2.patch'
198 applying 3.patch
537 applying 3.patch
199 applying 4.patch
538 applying 4.patch
200 applying 5.patch
539 applying 5.patch
201 now at: 5.patch
540 applying 6.patch
541 now at: 6.patch
542 5: imported patch 6.patch - johndeere
202 4: imported patch 5.patch - johndeere
543 4: imported patch 5.patch - johndeere
203 3: Four - jane
544 3: Four - jane
204 2: Three (again) - maria
545 2: Three (again) - maria
205 1: imported patch 2.patch - jane
546 1: imported patch 2.patch - jane
206 0: imported patch 1.patch - mary
547 0: imported patch 1.patch - mary
548 ==== init
549 ==== qnew -U
550 # HG changeset patch
551 # Parent
552 # User test
553 0: [mq]: 1.patch - test
554 ==== qref
555 adding 1
556 # HG changeset patch
557 # Parent
558 # User test
559
560 diff -r ... 1
561 --- /dev/null
562 +++ b/1
563 @@ -0,0 +1,1 @@
564 +1
565 0: [mq]: 1.patch - test
566 ==== qref -u
567 # HG changeset patch
568 # Parent
569 # User mary
570
571 diff -r ... 1
572 --- /dev/null
573 +++ b/1
574 @@ -0,0 +1,1 @@
575 +1
576 0: [mq]: 1.patch - mary
577 ==== qnew
578 adding 2
579 # HG changeset patch
580 # Parent
581
582 diff -r ... 2
583 --- /dev/null
584 +++ b/2
585 @@ -0,0 +1,1 @@
586 +2
587 1: [mq]: 2.patch - test
588 0: [mq]: 1.patch - mary
589 ==== qref -u
590 # HG changeset patch
591 # User jane
592 # Parent
593
594 diff -r ... 2
595 --- /dev/null
596 +++ b/2
597 @@ -0,0 +1,1 @@
598 +2
599 1: [mq]: 2.patch - jane
600 0: [mq]: 1.patch - mary
601 ==== qnew -U -m
602 # HG changeset patch
603 # Parent
604 # User test
605 Three
606
607 2: Three - test
608 1: [mq]: 2.patch - jane
609 0: [mq]: 1.patch - mary
610 ==== qref
611 adding 3
612 # HG changeset patch
613 # Parent
614 # User test
615 Three
616
617 diff -r ... 3
618 --- /dev/null
619 +++ b/3
620 @@ -0,0 +1,1 @@
621 +3
622 2: Three - test
623 1: [mq]: 2.patch - jane
624 0: [mq]: 1.patch - mary
625 ==== qref -m
626 # HG changeset patch
627 # Parent
628 # User test
629 Drei
630
631 diff -r ... 3
632 --- /dev/null
633 +++ b/3
634 @@ -0,0 +1,1 @@
635 +3
636 2: Drei - test
637 1: [mq]: 2.patch - jane
638 0: [mq]: 1.patch - mary
639 ==== qref -u
640 # HG changeset patch
641 # Parent
642 # User mary
643 Drei
644
645 diff -r ... 3
646 --- /dev/null
647 +++ b/3
648 @@ -0,0 +1,1 @@
649 +3
650 2: Drei - mary
651 1: [mq]: 2.patch - jane
652 0: [mq]: 1.patch - mary
653 ==== qref -u -m
654 # HG changeset patch
655 # Parent
656 # User maria
657 Three (again)
658
659 diff -r ... 3
660 --- /dev/null
661 +++ b/3
662 @@ -0,0 +1,1 @@
663 +3
664 2: Three (again) - maria
665 1: [mq]: 2.patch - jane
666 0: [mq]: 1.patch - mary
667 ==== qnew -m
668 adding 4of
669 # HG changeset patch
670 # Parent
671 Four
672
673 diff -r ... 4of
674 --- /dev/null
675 +++ b/4of
676 @@ -0,0 +1,1 @@
677 +4 t
678 3: Four - test
679 2: Three (again) - maria
680 1: [mq]: 2.patch - jane
681 0: [mq]: 1.patch - mary
682 ==== qref -u
683 # HG changeset patch
684 # User jane
685 # Parent
686 Four
687
688 diff -r ... 4of
689 --- /dev/null
690 +++ b/4of
691 @@ -0,0 +1,1 @@
692 +4 t
693 3: Four - jane
694 2: Three (again) - maria
695 1: [mq]: 2.patch - jane
696 0: [mq]: 1.patch - mary
697 ==== qnew with HG header
698 popping 5.patch
699 now at: 4.patch
700 now at: 5.patch
701 # HG changeset patch
702 # User johndoe
703 4: imported patch 5.patch - johndoe
704 3: Four - jane
705 2: Three (again) - maria
706 1: [mq]: 2.patch - jane
707 0: [mq]: 1.patch - mary
708 ==== hg qref
709 adding 5
710 # HG changeset patch
711 # Parent
712 # User johndoe
713
714 diff -r ... 5
715 --- /dev/null
716 +++ b/5
717 @@ -0,0 +1,1 @@
718 +5
719 4: [mq]: 5.patch - johndoe
720 3: Four - jane
721 2: Three (again) - maria
722 1: [mq]: 2.patch - jane
723 0: [mq]: 1.patch - mary
724 ==== hg qref -U
725 # HG changeset patch
726 # Parent
727 # User test
728
729 diff -r ... 5
730 --- /dev/null
731 +++ b/5
732 @@ -0,0 +1,1 @@
733 +5
734 4: [mq]: 5.patch - test
735 3: Four - jane
736 2: Three (again) - maria
737 1: [mq]: 2.patch - jane
738 0: [mq]: 1.patch - mary
739 ==== hg qref -u
740 # HG changeset patch
741 # Parent
742 # User johndeere
743
744 diff -r ... 5
745 --- /dev/null
746 +++ b/5
747 @@ -0,0 +1,1 @@
748 +5
749 4: [mq]: 5.patch - johndeere
750 3: Four - jane
751 2: Three (again) - maria
752 1: [mq]: 2.patch - jane
753 0: [mq]: 1.patch - mary
754 ==== qnew with plain header
755 popping 6.patch
756 now at: 5.patch
757 now at: 6.patch
758 From: test
759
760 5: imported patch 6.patch - test
761 4: [mq]: 5.patch - johndeere
762 3: Four - jane
763 2: Three (again) - maria
764 1: [mq]: 2.patch - jane
765 0: [mq]: 1.patch - mary
766 ==== hg qref
767 adding 6
768 From: test
769
770 diff -r ... 6
771 --- /dev/null
772 +++ b/6
773 @@ -0,0 +1,1 @@
774 +6
775 5: [mq]: 6.patch - test
776 4: [mq]: 5.patch - johndeere
777 3: Four - jane
778 2: Three (again) - maria
779 1: [mq]: 2.patch - jane
780 0: [mq]: 1.patch - mary
781 ==== hg qref -U
782 From: test
783
784 diff -r ... 6
785 --- /dev/null
786 +++ b/6
787 @@ -0,0 +1,1 @@
788 +6
789 5: [mq]: 6.patch - test
790 4: [mq]: 5.patch - johndeere
791 3: Four - jane
792 2: Three (again) - maria
793 1: [mq]: 2.patch - jane
794 0: [mq]: 1.patch - mary
795 ==== hg qref -u
796 From: johndeere
797
798 diff -r ... 6
799 --- /dev/null
800 +++ b/6
801 @@ -0,0 +1,1 @@
802 +6
803 5: [mq]: 6.patch - johndeere
804 4: [mq]: 5.patch - johndeere
805 3: Four - jane
806 2: Three (again) - maria
807 1: [mq]: 2.patch - jane
808 0: [mq]: 1.patch - mary
809 ==== qpop -a / qpush -a
810 popping 6.patch
811 popping 5.patch
812 popping 4.patch
813 popping 3.patch
814 popping 2.patch
815 popping 1.patch
816 patch queue now empty
817 applying 1.patch
818 applying 2.patch
819 applying 3.patch
820 applying 4.patch
821 applying 5.patch
822 applying 6.patch
823 now at: 6.patch
824 5: imported patch 6.patch - johndeere
825 4: imported patch 5.patch - johndeere
826 3: Four - jane
827 2: Three (again) - maria
828 1: imported patch 2.patch - jane
829 0: imported patch 1.patch - mary
@@ -34,6 +34,9 b' 0 files updated, 2 files merged, 0 files'
34 applying patcha2
34 applying patcha2
35 now at: patcha2
35 now at: patcha2
36 % check patcha is still a git patch
36 % check patcha is still a git patch
37 # HG changeset patch
38 # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4
39
37 diff --git a/a b/a
40 diff --git a/a b/a
38 --- a/a
41 --- a/a
39 +++ b/a
42 +++ b/a
@@ -12,6 +12,11 b' filterdiff()'
12 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
12 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
13 }
13 }
14
14
15 filterpatch()
16 {
17 sed -e "s/\(# Parent \).*/\1/"
18 }
19
15 echo '% init'
20 echo '% init'
16 hg init repo
21 hg init repo
17 cd repo
22 cd repo
@@ -43,7 +48,7 b' hg cp a aa'
43 hg qnew --git -f git
48 hg qnew --git -f git
44 hg qpop
49 hg qpop
45 hg qfold git
50 hg qfold git
46 cat .hg/patches/regular
51 cat .hg/patches/regular | filterpatch
47 hg qpop
52 hg qpop
48 hg qdel regular
53 hg qdel regular
49
54
@@ -54,7 +59,7 b' echo b >> aa'
54 hg qnew -f regular
59 hg qnew -f regular
55 hg qpop
60 hg qpop
56 hg qfold regular
61 hg qfold regular
57 cat .hg/patches/git
62 cat .hg/patches/git | filterpatch
58
63
59 cd ..
64 cd ..
60
65
@@ -29,6 +29,9 b' reverting a'
29 % fold git patch into a regular patch, expect git patch
29 % fold git patch into a regular patch, expect git patch
30 popping git
30 popping git
31 now at: regular
31 now at: regular
32 # HG changeset patch
33 # Parent
34
32 diff --git a/a b/a
35 diff --git a/a b/a
33 --- a/a
36 --- a/a
34 +++ b/a
37 +++ b/a
@@ -52,6 +55,9 b' now at: p1'
52 % fold regular patch into a git patch, expect git patch
55 % fold regular patch into a git patch, expect git patch
53 popping regular
56 popping regular
54 now at: git
57 now at: git
58 # HG changeset patch
59 # Parent
60
55 diff --git a/a b/aa
61 diff --git a/a b/aa
56 copy from a
62 copy from a
57 copy to aa
63 copy to aa
@@ -1,73 +1,102 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 catpatch() {
4 cat $1 | sed -e "s/^\(# Parent \).*/\1/"
5 }
6
3 echo "[extensions]" >> $HGRCPATH
7 echo "[extensions]" >> $HGRCPATH
4 echo "mq=" >> $HGRCPATH
8 echo "mq=" >> $HGRCPATH
5
9
6 hg init mq
10 runtest() {
7 cd mq
11 hg init mq
12 cd mq
8
13
9 echo a > a
14 echo a > a
10 hg ci -Ama
15 hg ci -Ama
11
16
12 echo '% qnew should refuse bad patch names'
17 echo '% qnew should refuse bad patch names'
13 hg qnew series
18 hg qnew series
14 hg qnew status
19 hg qnew status
15 hg qnew guards
20 hg qnew guards
16 hg qnew .hgignore
21 hg qnew .hgignore
17
22
18 hg qinit -c
23 hg qinit -c
19
24
20 echo '% qnew with uncommitted changes'
25 echo '% qnew with uncommitted changes'
21 echo a > somefile
26 echo a > somefile
22 hg add somefile
27 hg add somefile
23 hg qnew uncommitted.patch
28 hg qnew uncommitted.patch
24 hg st
29 hg st
25 hg qseries
30 hg qseries
31
32 echo '% qnew implies add'
33 hg -R .hg/patches st
26
34
27 echo '% qnew implies add'
35 echo '% qnew missing'
28 hg -R .hg/patches st
36 hg qnew missing.patch missing
37
38 echo '% qnew -m'
39 hg qnew -m 'foo bar' mtest.patch
40 catpatch .hg/patches/mtest.patch
29
41
30 echo '% qnew missing'
42 echo '% qnew twice'
31 hg qnew missing.patch missing
43 hg qnew first.patch
44 hg qnew first.patch
32
45
33 echo '% qnew -m'
46 touch ../first.patch
34 hg qnew -m 'foo bar' mtest.patch
47 hg qimport ../first.patch
35 cat .hg/patches/mtest.patch
36
48
37 echo '% qnew twice'
49 echo '% qnew -f from a subdirectory'
38 hg qnew first.patch
50 hg qpop -a
39 hg qnew first.patch
51 mkdir d
40
52 cd d
41 touch ../first.patch
53 echo b > b
42 hg qimport ../first.patch
54 hg ci -Am t
55 echo b >> b
56 hg st
57 hg qnew -g -f p
58 catpatch ../.hg/patches/p
43
59
44 echo '% qnew -f from a subdirectory'
60 echo '% qnew -u with no username configured'
45 hg qpop -a
61 HGUSER= hg qnew -u blue red
46 mkdir d
62 catpatch ../.hg/patches/red
47 cd d
48 echo b > b
49 hg ci -Am t
50 echo b >> b
51 hg st
52 hg qnew -g -f p
53 cat ../.hg/patches/p
54
63
55 echo '% qnew -u with no username configured'
64 echo '% fail when trying to import a merge'
56 HGUSER= hg qnew -u blue red
65 hg init merge
57 cat ../.hg/patches/red
66 cd merge
67 touch a
68 hg ci -Am null
69 echo a >> a
70 hg ci -m a
71 hg up -r 0
72 echo b >> a
73 hg ci -m b
74 hg merge -f 1
75 hg resolve --mark a
76 hg qnew -f merge
77
78 cd ../../..
79 rm -r mq
80 }
81
58
82
59 echo '% fail when trying to import a merge'
83 echo '%%% plain headers'
60 hg init merge
84
61 cd merge
85 echo "[mq]" >> $HGRCPATH
62 touch a
86 echo "plain=true" >> $HGRCPATH
63 hg ci -Am null
87
64 echo a >> a
88 mkdir sandbox
65 hg ci -m a
89 (cd sandbox ; runtest)
66 hg up -r 0
90 rm -r sandbox
67 echo b >> a
91
68 hg ci -m b
92
69 hg merge -f 1
93 echo '%%% hg headers'
70 hg resolve --mark a
94
71 hg qnew -f merge
95 echo "plain=false" >> $HGRCPATH
96
97 mkdir sandbox
98 (cd sandbox ; runtest)
99 rm -r sandbox
100
72
101
73 exit 0
102 exit 0
@@ -1,3 +1,4 b''
1 %%% plain headers
1 adding a
2 adding a
2 % qnew should refuse bad patch names
3 % qnew should refuse bad patch names
3 abort: "series" cannot be used as the name of a patch
4 abort: "series" cannot be used as the name of a patch
@@ -44,3 +45,55 b' merging a failed!'
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
45 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
45 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
46 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
46 abort: cannot manage merge changesets
47 abort: cannot manage merge changesets
48 %%% hg headers
49 adding a
50 % qnew should refuse bad patch names
51 abort: "series" cannot be used as the name of a patch
52 abort: "status" cannot be used as the name of a patch
53 abort: "guards" cannot be used as the name of a patch
54 abort: ".hgignore" cannot be used as the name of a patch
55 % qnew with uncommitted changes
56 uncommitted.patch
57 % qnew implies add
58 A .hgignore
59 A series
60 A uncommitted.patch
61 % qnew missing
62 abort: missing: No such file or directory
63 % qnew -m
64 # HG changeset patch
65 # Parent
66 foo bar
67
68 % qnew twice
69 abort: patch "first.patch" already exists
70 abort: patch "first.patch" already exists
71 % qnew -f from a subdirectory
72 popping first.patch
73 popping mtest.patch
74 popping uncommitted.patch
75 patch queue now empty
76 adding d/b
77 M d/b
78 # HG changeset patch
79 # Parent
80 diff --git a/d/b b/d/b
81 --- a/d/b
82 +++ b/d/b
83 @@ -1,1 +1,2 @@
84 b
85 +b
86 % qnew -u with no username configured
87 # HG changeset patch
88 # Parent
89 # User blue
90 % fail when trying to import a merge
91 adding a
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 created new head
94 merging a
95 warning: conflicts during merge.
96 merging a failed!
97 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
98 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
99 abort: cannot manage merge changesets
@@ -29,7 +29,7 b' echo bar > bar'
29 hg add bar
29 hg add bar
30 hg qrefresh -m 'patch 2'
30 hg qrefresh -m 'patch 2'
31
31
32 hg qnew bad-patch
32 hg qnew --config 'mq.plain=true' bad-patch
33 echo >> foo
33 echo >> foo
34 hg qrefresh
34 hg qrefresh
35
35
@@ -3,6 +3,10 b''
3 echo "[extensions]" >> $HGRCPATH
3 echo "[extensions]" >> $HGRCPATH
4 echo "mq=" >> $HGRCPATH
4 echo "mq=" >> $HGRCPATH
5
5
6 catpatch() {
7 cat $1 | sed -e "s/^\(# Parent \).*/\1/"
8 }
9
6 echo % init
10 echo % init
7 hg init a
11 hg init a
8 cd a
12 cd a
@@ -30,7 +34,7 b' hg qdiff . | sed -e "s/\\(+++ [a-zA-Z0-9_'
30 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
34 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
31
35
32 echo % patch file contents
36 echo % patch file contents
33 cat .hg/patches/mqbase | \
37 catpatch .hg/patches/mqbase | \
34 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
38 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
35 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
39 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
36
40
@@ -47,7 +51,7 b' hg qdiff . | sed -e "s/\\(+++ [a-zA-Z0-9_'
47 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
51 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
48
52
49 echo % patch file contents
53 echo % patch file contents
50 cat .hg/patches/mqbase | \
54 catpatch .hg/patches/mqbase | \
51 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
55 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
52 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
56 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
53
57
@@ -63,7 +67,7 b' hg qdiff . | sed -e "s/\\(+++ [a-zA-Z0-9_'
63 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
67 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
64
68
65 echo % patch file contents
69 echo % patch file contents
66 cat .hg/patches/mqbase | \
70 catpatch .hg/patches/mqbase | \
67 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
71 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
68 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
72 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
69
73
@@ -79,7 +83,7 b' hg qdiff . | sed -e "s/\\(+++ [a-zA-Z0-9_'
79 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
83 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
80
84
81 echo % patch file contents
85 echo % patch file contents
82 cat .hg/patches/mqbase | \
86 catpatch .hg/patches/mqbase | \
83 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
87 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
84 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
88 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
85
89
@@ -98,7 +102,7 b' hg qdiff | sed -e "s/\\(+++ [a-zA-Z0-9_/.'
98 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
102 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
99
103
100 echo % -- patch file content
104 echo % -- patch file content
101 cat .hg/patches/mqbase | \
105 catpatch .hg/patches/mqbase | \
102 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
106 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
103 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
107 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
104 hg st
108 hg st
@@ -176,7 +180,7 b' hg st'
176 echo '% b after refresh'
180 echo '% b after refresh'
177 cat b
181 cat b
178 echo '% patch file after refresh'
182 echo '% patch file after refresh'
179 cat .hg/patches/patch
183 catpatch .hg/patches/patch
180 cd ..
184 cd ..
181
185
182
186
@@ -31,6 +31,8 b' diff -r b55ecdccb5cf 2/base'
31 -base
31 -base
32 +patched
32 +patched
33 % patch file contents
33 % patch file contents
34 # HG changeset patch
35 # Parent
34 mqbase
36 mqbase
35
37
36 diff -r b55ecdccb5cf 1/base
38 diff -r b55ecdccb5cf 1/base
@@ -73,6 +75,8 b' diff -r b55ecdccb5cf 2/base'
73 -base
75 -base
74 +patched
76 +patched
75 % patch file contents
77 % patch file contents
78 # HG changeset patch
79 # Parent
76 mqbase
80 mqbase
77
81
78 diff -r b55ecdccb5cf 1/base
82 diff -r b55ecdccb5cf 1/base
@@ -109,6 +113,8 b' diff -r b55ecdccb5cf 2/base'
109 -base
113 -base
110 +patched
114 +patched
111 % patch file contents
115 % patch file contents
116 # HG changeset patch
117 # Parent
112 mqbase
118 mqbase
113
119
114 diff -r b55ecdccb5cf 1/base
120 diff -r b55ecdccb5cf 1/base
@@ -145,6 +151,8 b' diff -r b55ecdccb5cf 2/base'
145 -base
151 -base
146 +patched
152 +patched
147 % patch file contents
153 % patch file contents
154 # HG changeset patch
155 # Parent
148 mqbase
156 mqbase
149
157
150 diff -r b55ecdccb5cf 1/base
158 diff -r b55ecdccb5cf 1/base
@@ -181,6 +189,8 b' diff -r b55ecdccb5cf orphanchild'
181 @@ -0,0 +1,1 @@
189 @@ -0,0 +1,1 @@
182 +orphan
190 +orphan
183 % -- patch file content
191 % -- patch file content
192 # HG changeset patch
193 # Parent
184 mqbase
194 mqbase
185
195
186 diff -r b55ecdccb5cf 1/base
196 diff -r b55ecdccb5cf 1/base
@@ -273,6 +283,9 b' M a'
273 b
283 b
274 b
284 b
275 % patch file after refresh
285 % patch file after refresh
286 # HG changeset patch
287 # Parent
288
276 diff -r 1a60229be7ac b
289 diff -r 1a60229be7ac b
277 --- a/b
290 --- a/b
278 +++ b/b
291 +++ b/b
@@ -5,6 +5,9 b' echo "graphlog=" >> $HGRCPATH'
5 echo "rebase=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
6 echo "mq=" >> $HGRCPATH
6 echo "mq=" >> $HGRCPATH
7
7
8 echo "[mq]" >> $HGRCPATH
9 echo "plain=true" >> $HGRCPATH
10
8 filterpatch()
11 filterpatch()
9 {
12 {
10 sed -e "s/^\(# Date\).*/\1/" \
13 sed -e "s/^\(# Date\).*/\1/" \
General Comments 0
You need to be logged in to leave comments. Login now