Show More
@@ -0,0 +1,44 b'' | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | echo '[extensions]' >> $HGRCPATH | |
|
4 | echo 'hgext.mq =' >> $HGRCPATH | |
|
5 | ||
|
6 | hg init repo | |
|
7 | cd repo | |
|
8 | ||
|
9 | echo foo > foo | |
|
10 | hg ci -qAm 'add a file' | |
|
11 | ||
|
12 | hg qinit | |
|
13 | ||
|
14 | hg qnew foo | |
|
15 | echo foo >> foo | |
|
16 | hg qrefresh -m 'append foo' | |
|
17 | ||
|
18 | hg qnew bar | |
|
19 | echo bar >> foo | |
|
20 | hg qrefresh -m 'append bar' | |
|
21 | ||
|
22 | echo '% try to commit on top of a patch' | |
|
23 | echo quux >> foo | |
|
24 | hg ci -m 'append quux' | |
|
25 | ||
|
26 | # cheat a bit... | |
|
27 | mv .hg/patches .hg/patches2 | |
|
28 | hg ci -m 'append quux' | |
|
29 | mv .hg/patches2 .hg/patches | |
|
30 | ||
|
31 | echo '% qpop/qrefresh on the wrong revision' | |
|
32 | hg qpop | |
|
33 | hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/' | |
|
34 | hg qrefresh | |
|
35 | ||
|
36 | hg up -C qtip | |
|
37 | echo '% qpop' | |
|
38 | hg qpop | |
|
39 | ||
|
40 | echo '% qrefresh' | |
|
41 | hg qrefresh | |
|
42 | ||
|
43 | echo '% tip:' | |
|
44 | hg tip --template '#rev# #desc#\n' |
@@ -0,0 +1,14 b'' | |||
|
1 | % try to commit on top of a patch | |
|
2 | abort: cannot commit over an applied mq patch | |
|
3 | % qpop/qrefresh on the wrong revision | |
|
4 | abort: working directory revision is not qtip | |
|
5 | using patch queue: | |
|
6 | abort: popping would remove a revision not managed by this patch queue | |
|
7 | abort: working directory revision is not qtip | |
|
8 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
9 | % qpop | |
|
10 | abort: popping would remove a revision not managed by this patch queue | |
|
11 | % qrefresh | |
|
12 | abort: cannot refresh a revision with children | |
|
13 | % tip: | |
|
14 | 3 append quux |
@@ -30,8 +30,8 b" SKIPREV = 'SKIP'" | |||
|
30 | 30 | class commit(object): |
|
31 | 31 | def __init__(self, author, date, desc, parents, branch=None, rev=None, |
|
32 | 32 | extra={}): |
|
33 | self.author = author | |
|
34 | self.date = date | |
|
33 | self.author = author or 'unknown' | |
|
34 | self.date = date or '0 0' | |
|
35 | 35 | self.desc = desc |
|
36 | 36 | self.parents = parents |
|
37 | 37 | self.branch = branch |
@@ -102,7 +102,6 b' class convert_git(converter_source):' | |||
|
102 | 102 | tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:] |
|
103 | 103 | tz = -int(tzs) * (int(tzh) * 3600 + int(tzm)) |
|
104 | 104 | date = tm + " " + str(tz) |
|
105 | author = author or "unknown" | |
|
106 | 105 | |
|
107 | 106 | c = commit(parents=parents, date=date, author=author, desc=message, |
|
108 | 107 | rev=version) |
@@ -600,11 +600,19 b' class queue:' | |||
|
600 | 600 | raise util.Abort(_("local changes found")) |
|
601 | 601 | return m, a, r, d |
|
602 | 602 | |
|
603 | _reserved = ('series', 'status', 'guards') | |
|
604 | def check_reserved_name(self, name): | |
|
605 | if (name in self._reserved or name.startswith('.hg') | |
|
606 | or name.startswith('.mq')): | |
|
607 | raise util.Abort(_('"%s" cannot be used as the name of a patch') | |
|
608 | % name) | |
|
609 | ||
|
603 | 610 | def new(self, repo, patch, *pats, **opts): |
|
604 | 611 | msg = opts.get('msg') |
|
605 | 612 | force = opts.get('force') |
|
606 | 613 | user = opts.get('user') |
|
607 | 614 | date = opts.get('date') |
|
615 | self.check_reserved_name(patch) | |
|
608 | 616 | if os.path.exists(self.join(patch)): |
|
609 | 617 | raise util.Abort(_('patch "%s" already exists') % patch) |
|
610 | 618 | if opts.get('include') or opts.get('exclude') or pats: |
@@ -872,10 +880,16 b' class queue:' | |||
|
872 | 880 | start = info[0] |
|
873 | 881 | rev = revlog.bin(info[1]) |
|
874 | 882 | |
|
883 | if update: | |
|
884 | top = self.check_toppatch(repo) | |
|
885 | ||
|
886 | if repo.changelog.heads(rev) != [revlog.bin(self.applied[-1].rev)]: | |
|
887 | raise util.Abort("popping would remove a revision not " | |
|
888 | "managed by this patch queue") | |
|
889 | ||
|
875 | 890 | # we know there are no local changes, so we can make a simplified |
|
876 | 891 | # form of hg.update. |
|
877 | 892 | if update: |
|
878 | top = self.check_toppatch(repo) | |
|
879 | 893 | qp = self.qparents(repo, rev) |
|
880 | 894 | changes = repo.changelog.read(qp) |
|
881 | 895 | mmap = repo.manifest.read(changes[0]) |
@@ -898,8 +912,8 b' class queue:' | |||
|
898 | 912 | except: pass |
|
899 | 913 | repo.dirstate.forget(f) |
|
900 | 914 | repo.dirstate.setparents(qp, revlog.nullid) |
|
915 | del self.applied[start:end] | |
|
901 | 916 | self.strip(repo, rev, update=False, backup='strip') |
|
902 | del self.applied[start:end] | |
|
903 | 917 | if len(self.applied): |
|
904 | 918 | self.ui.write("Now at: %s\n" % self.applied[-1].name) |
|
905 | 919 | else: |
@@ -926,6 +940,8 b' class queue:' | |||
|
926 | 940 | self.check_toppatch(repo) |
|
927 | 941 | (top, patchfn) = (self.applied[-1].rev, self.applied[-1].name) |
|
928 | 942 | top = revlog.bin(top) |
|
943 | if repo.changelog.heads(top) != [top]: | |
|
944 | raise util.Abort("cannot refresh a revision with children") | |
|
929 | 945 | cparents = repo.changelog.parents(top) |
|
930 | 946 | patchparent = self.qparents(repo, top) |
|
931 | 947 | message, comments, user, date, patchfound = self.readheaders(patchfn) |
@@ -1112,12 +1128,13 b' class queue:' | |||
|
1112 | 1128 | if not user: |
|
1113 | 1129 | user = changes[1] |
|
1114 | 1130 | |
|
1131 | self.applied.pop() | |
|
1132 | self.applied_dirty = 1 | |
|
1115 | 1133 | self.strip(repo, top, update=False, |
|
1116 | 1134 | backup='strip') |
|
1117 | 1135 | n = repo.commit(filelist, message, user, date, match=matchfn, |
|
1118 | 1136 | force=1) |
|
1119 |
self.applied |
|
|
1120 | self.applied_dirty = 1 | |
|
1137 | self.applied.append(statusentry(revlog.hex(n), patchfn)) | |
|
1121 | 1138 | self.removeundo(repo) |
|
1122 | 1139 | else: |
|
1123 | 1140 | self.printdiff(repo, patchparent, fp=patchf) |
@@ -1406,6 +1423,7 b' class queue:' | |||
|
1406 | 1423 | |
|
1407 | 1424 | if not patchname: |
|
1408 | 1425 | patchname = normname('%d.diff' % r) |
|
1426 | self.check_reserved_name(patchname) | |
|
1409 | 1427 | checkseries(patchname) |
|
1410 | 1428 | checkfile(patchname) |
|
1411 | 1429 | self.full_series.insert(0, patchname) |
@@ -1428,6 +1446,7 b' class queue:' | |||
|
1428 | 1446 | raise util.Abort(_('-e is incompatible with import from -')) |
|
1429 | 1447 | if not patchname: |
|
1430 | 1448 | patchname = normname(filename) |
|
1449 | self.check_reserved_name(patchname) | |
|
1431 | 1450 | if not os.path.isfile(self.join(patchname)): |
|
1432 | 1451 | raise util.Abort(_("patch %s does not exist") % patchname) |
|
1433 | 1452 | else: |
@@ -1442,6 +1461,7 b' class queue:' | |||
|
1442 | 1461 | raise util.Abort(_("unable to read %s") % patchname) |
|
1443 | 1462 | if not patchname: |
|
1444 | 1463 | patchname = normname(os.path.basename(filename)) |
|
1464 | self.check_reserved_name(patchname) | |
|
1445 | 1465 | checkfile(patchname) |
|
1446 | 1466 | patchf = self.opener(patchname, "w") |
|
1447 | 1467 | patchf.write(text) |
@@ -2147,6 +2167,12 b' def reposetup(ui, repo):' | |||
|
2147 | 2167 | return tagscache |
|
2148 | 2168 | |
|
2149 | 2169 | mqtags = [(revlog.bin(patch.rev), patch.name) for patch in q.applied] |
|
2170 | ||
|
2171 | if mqtags[-1][0] not in self.changelog.nodemap: | |
|
2172 | self.ui.warn('mq status file refers to unknown node %s\n' | |
|
2173 | % revlog.short(mqtags[-1][0])) | |
|
2174 | return tagscache | |
|
2175 | ||
|
2150 | 2176 | mqtags.append((mqtags[-1][0], 'qtip')) |
|
2151 | 2177 | mqtags.append((mqtags[0][0], 'qbase')) |
|
2152 | 2178 | mqtags.append((self.changelog.parents(mqtags[0][0])[0], 'qparent')) |
@@ -2163,11 +2189,17 b' def reposetup(ui, repo):' | |||
|
2163 | 2189 | if not q.applied: |
|
2164 | 2190 | return super(mqrepo, self)._branchtags() |
|
2165 | 2191 | |
|
2192 | cl = self.changelog | |
|
2193 | qbasenode = revlog.bin(q.applied[0].rev) | |
|
2194 | if qbasenode not in cl.nodemap: | |
|
2195 | self.ui.warn('mq status file refers to unknown node %s\n' | |
|
2196 | % revlog.short(qbasenode)) | |
|
2197 | return super(mqrepo, self)._branchtags() | |
|
2198 | ||
|
2166 | 2199 | self.branchcache = {} # avoid recursion in changectx |
|
2167 | cl = self.changelog | |
|
2168 | 2200 | partial, last, lrev = self._readbranchcache() |
|
2169 | 2201 | |
|
2170 |
qbase = cl.rev( |
|
|
2202 | qbase = cl.rev(qbasenode) | |
|
2171 | 2203 | start = lrev + 1 |
|
2172 | 2204 | if start < qbase: |
|
2173 | 2205 | # update the cache (excluding the patches) and save it |
@@ -1540,6 +1540,9 b' def import_(ui, repo, patch1, *patches, ' | |||
|
1540 | 1540 | repo.rollback() |
|
1541 | 1541 | raise util.Abort(_('patch is damaged' |
|
1542 | 1542 | ' or loses information')) |
|
1543 | # Force a dirstate write so that the next transaction | |
|
1544 | # backups an up-do-date file. | |
|
1545 | repo.dirstate.write() | |
|
1543 | 1546 | finally: |
|
1544 | 1547 | os.unlink(tmpname) |
|
1545 | 1548 | finally: |
@@ -103,10 +103,13 b' class httpconnection(keepalive.HTTPConne' | |||
|
103 | 103 | # must be able to send big bundle as stream. |
|
104 | 104 | send = _gen_sendfile(keepalive.HTTPConnection) |
|
105 | 105 | |
|
106 |
class |
|
|
106 | class httphandler(keepalive.HTTPHandler): | |
|
107 | 107 | def http_open(self, req): |
|
108 | 108 | return self.do_open(httpconnection, req) |
|
109 | 109 | |
|
110 | def __del__(self): | |
|
111 | self.close_all() | |
|
112 | ||
|
110 | 113 | has_https = hasattr(urllib2, 'HTTPSHandler') |
|
111 | 114 | if has_https: |
|
112 | 115 | class httpsconnection(httplib.HTTPSConnection): |
@@ -114,12 +117,9 b' if has_https:' | |||
|
114 | 117 | # must be able to send big bundle as stream. |
|
115 | 118 | send = _gen_sendfile(httplib.HTTPSConnection) |
|
116 | 119 | |
|
117 |
class httphandler( |
|
|
120 | class httpshandler(keepalive.KeepAliveHandler, urllib2.HTTPSHandler): | |
|
118 | 121 | def https_open(self, req): |
|
119 | 122 | return self.do_open(httpsconnection, req) |
|
120 | else: | |
|
121 | class httphandler(basehttphandler): | |
|
122 | pass | |
|
123 | 123 | |
|
124 | 124 | # In python < 2.5 AbstractDigestAuthHandler raises a ValueError if |
|
125 | 125 | # it doesn't know about the auth type requested. This can happen if |
@@ -203,8 +203,9 b' class httprepository(remoterepository):' | |||
|
203 | 203 | |
|
204 | 204 | proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy') |
|
205 | 205 | # XXX proxyauthinfo = None |
|
206 |
|
|
|
207 | handlers = [self.handler] | |
|
206 | handlers = [httphandler()] | |
|
207 | if has_https: | |
|
208 | handlers.append(httpshandler()) | |
|
208 | 209 | |
|
209 | 210 | if proxyurl: |
|
210 | 211 | # proxy can be proper url or host[:port] |
@@ -270,11 +271,6 b' class httprepository(remoterepository):' | |||
|
270 | 271 | opener.addheaders = [('User-agent', 'mercurial/proto-1.0')] |
|
271 | 272 | urllib2.install_opener(opener) |
|
272 | 273 | |
|
273 | def __del__(self): | |
|
274 | if self.handler: | |
|
275 | self.handler.close_all() | |
|
276 | self.handler = None | |
|
277 | ||
|
278 | 274 | def url(self): |
|
279 | 275 | return self.path |
|
280 | 276 |
@@ -175,7 +175,7 b' class ConnectionManager:' | |||
|
175 | 175 | else: |
|
176 | 176 | return dict(self._hostmap) |
|
177 | 177 | |
|
178 | class HTTPHandler(urllib2.HTTPHandler): | |
|
178 | class KeepAliveHandler: | |
|
179 | 179 | def __init__(self): |
|
180 | 180 | self._cm = ConnectionManager() |
|
181 | 181 | |
@@ -314,6 +314,9 b' class HTTPHandler(urllib2.HTTPHandler):' | |||
|
314 | 314 | except socket.error, err: # XXX what error? |
|
315 | 315 | raise urllib2.URLError(err) |
|
316 | 316 | |
|
317 | class HTTPHandler(KeepAliveHandler, urllib2.HTTPHandler): | |
|
318 | pass | |
|
319 | ||
|
317 | 320 | class HTTPResponse(httplib.HTTPResponse): |
|
318 | 321 | # we need to subclass HTTPResponse in order to |
|
319 | 322 | # 1) add readline() and readlines() methods |
@@ -120,6 +120,7 b' class localrepository(repo.repository):' | |||
|
120 | 120 | self.hook('pretag', throw=True, node=hex(node), tag=name, local=local) |
|
121 | 121 | |
|
122 | 122 | def writetag(fp, name, munge, prevtags): |
|
123 | fp.seek(0, 2) | |
|
123 | 124 | if prevtags and prevtags[-1] != '\n': |
|
124 | 125 | fp.write('\n') |
|
125 | 126 | fp.write('%s %s\n' % (hex(node), munge and munge(name) or name)) |
@@ -1981,6 +1982,10 b' class localrepository(repo.repository):' | |||
|
1981 | 1982 | del tr |
|
1982 | 1983 | |
|
1983 | 1984 | if changesets > 0: |
|
1985 | # forcefully update the on-disk branch cache | |
|
1986 | self.ui.debug(_("updating the branch cache\n")) | |
|
1987 | self.branchcache = None | |
|
1988 | self.branchtags() | |
|
1984 | 1989 | self.hook("changegroup", node=hex(self.changelog.node(cor+1)), |
|
1985 | 1990 | source=srctype, url=url) |
|
1986 | 1991 |
@@ -114,14 +114,25 b' class sshrepository(remoterepository):' | |||
|
114 | 114 | return self.pipei |
|
115 | 115 | |
|
116 | 116 | def call(self, cmd, **args): |
|
117 |
|
|
|
118 | l = r.readline() | |
|
117 | self.do_cmd(cmd, **args) | |
|
118 | return self._recv() | |
|
119 | ||
|
120 | def _recv(self): | |
|
121 | l = self.pipei.readline() | |
|
119 | 122 | self.readerr() |
|
120 | 123 | try: |
|
121 | 124 | l = int(l) |
|
122 | 125 | except: |
|
123 | 126 | self.raise_(util.UnexpectedOutput(_("unexpected response:"), l)) |
|
124 |
return |
|
|
127 | return self.pipei.read(l) | |
|
128 | ||
|
129 | def _send(self, data, flush=False): | |
|
130 | self.pipeo.write("%d\n" % len(data)) | |
|
131 | if data: | |
|
132 | self.pipeo.write(data) | |
|
133 | if flush: | |
|
134 | self.pipeo.flush() | |
|
135 | self.readerr() | |
|
125 | 136 | |
|
126 | 137 | def lock(self): |
|
127 | 138 | self.call("lock") |
@@ -182,25 +193,22 b' class sshrepository(remoterepository):' | |||
|
182 | 193 | |
|
183 | 194 | while 1: |
|
184 | 195 | d = cg.read(4096) |
|
185 |
if not d: |
|
|
186 | self.pipeo.write(str(len(d)) + '\n') | |
|
187 |
self. |
|
|
188 | self.readerr() | |
|
196 | if not d: | |
|
197 | break | |
|
198 | self._send(d) | |
|
189 | 199 | |
|
190 | self.pipeo.write('0\n') | |
|
191 | self.pipeo.flush() | |
|
200 | self._send("", flush=True) | |
|
192 | 201 | |
|
193 |
self. |
|
|
194 | l = int(self.pipei.readline()) | |
|
195 | r = self.pipei.read(l) | |
|
202 | r = self._recv() | |
|
196 | 203 | if r: |
|
197 | 204 | # remote may send "unsynced changes" |
|
198 | 205 | self.raise_(repo.RepoError(_("push failed: %s") % r)) |
|
199 | 206 | |
|
200 |
self. |
|
|
201 | l = int(self.pipei.readline()) | |
|
202 | r = self.pipei.read(l) | |
|
207 | r = self._recv() | |
|
208 | try: | |
|
203 | 209 | return int(r) |
|
210 | except: | |
|
211 | self.raise_(util.UnexpectedOutput(_("unexpected response:"), r)) | |
|
204 | 212 | |
|
205 | 213 | def addchangegroup(self, cg, source, url): |
|
206 | 214 | d = self.call("addchangegroup") |
@@ -208,18 +216,21 b' class sshrepository(remoterepository):' | |||
|
208 | 216 | self.raise_(repo.RepoError(_("push refused: %s") % d)) |
|
209 | 217 | while 1: |
|
210 | 218 | d = cg.read(4096) |
|
211 |
if not d: |
|
|
219 | if not d: | |
|
220 | break | |
|
212 | 221 | self.pipeo.write(d) |
|
213 | 222 | self.readerr() |
|
214 | 223 | |
|
215 | 224 | self.pipeo.flush() |
|
216 | 225 | |
|
217 | 226 | self.readerr() |
|
218 |
|
|
|
219 | r = self.pipei.read(l) | |
|
227 | r = self._recv() | |
|
220 | 228 | if not r: |
|
221 | 229 | return 1 |
|
230 | try: | |
|
222 | 231 | return int(r) |
|
232 | except: | |
|
233 | self.raise_(util.UnexpectedOutput(_("unexpected response:"), r)) | |
|
223 | 234 | |
|
224 | 235 | def stream_out(self): |
|
225 | 236 | return self.do_cmd('stream_out') |
@@ -1,6 +1,6 b'' | |||
|
1 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|
2 | 2 | <html> |
|
3 | 3 | <head> |
|
4 | <link rel="icon" href="#staticurl#hgicon.png" type="image/png"> | |
|
4 | <link rel="icon" href="#staticurl#hgicon.png" type="image/png" /> | |
|
5 | 5 | <meta name="robots" content="index, nofollow" /> |
|
6 | 6 | <link rel="stylesheet" href="#staticurl#style.css" type="text/css" /> |
@@ -1,6 +1,6 b'' | |||
|
1 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|
2 | 2 | <html> |
|
3 | 3 | <head> |
|
4 | <link rel="icon" href="?static=hgicon.png" type="image/png"> | |
|
4 | <link rel="icon" href="?static=hgicon.png" type="image/png" /> | |
|
5 | 5 | <meta name="robots" content="index, nofollow" /> |
|
6 | 6 | <link rel="stylesheet" href="?static=style.css" type="text/css" /> |
@@ -28,6 +28,7 b' adding foo/Bar/file.txt revisions' | |||
|
28 | 28 | adding foo/file.txt revisions |
|
29 | 29 | adding quux/file.py revisions |
|
30 | 30 | added 3 changesets with 3 changes to 3 files |
|
31 | updating the branch cache | |
|
31 | 32 | rolling back last transaction |
|
32 | 33 | 0:6675d58eff77 |
|
33 | 34 | |
@@ -59,6 +60,7 b' calling hook pretxnchangegroup.acl: hgex' | |||
|
59 | 60 | acl: acl.allow not enabled |
|
60 | 61 | acl: acl.deny not enabled |
|
61 | 62 | acl: changes have source "push" - skipping |
|
63 | updating the branch cache | |
|
62 | 64 | rolling back last transaction |
|
63 | 65 | 0:6675d58eff77 |
|
64 | 66 | |
@@ -94,6 +96,7 b' acl: acl.deny not enabled' | |||
|
94 | 96 | acl: allowing changeset ef1ea85a6374 |
|
95 | 97 | acl: allowing changeset f9cafe1212c8 |
|
96 | 98 | acl: allowing changeset 911600dab2ae |
|
99 | updating the branch cache | |
|
97 | 100 | rolling back last transaction |
|
98 | 101 | 0:6675d58eff77 |
|
99 | 102 | |
@@ -383,6 +386,7 b' acl: acl.deny enabled, 0 entries for use' | |||
|
383 | 386 | acl: allowing changeset ef1ea85a6374 |
|
384 | 387 | acl: allowing changeset f9cafe1212c8 |
|
385 | 388 | acl: allowing changeset 911600dab2ae |
|
389 | updating the branch cache | |
|
386 | 390 | rolling back last transaction |
|
387 | 391 | 0:6675d58eff77 |
|
388 | 392 | |
@@ -578,6 +582,7 b' acl: acl.deny enabled, 0 entries for use' | |||
|
578 | 582 | acl: allowing changeset ef1ea85a6374 |
|
579 | 583 | acl: allowing changeset f9cafe1212c8 |
|
580 | 584 | acl: allowing changeset 911600dab2ae |
|
585 | updating the branch cache | |
|
581 | 586 | rolling back last transaction |
|
582 | 587 | 0:6675d58eff77 |
|
583 | 588 |
|
1 | NO CONTENT: modified file, binary diff hidden |
@@ -24,7 +24,7 b' 404 Not Found' | |||
|
24 | 24 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|
25 | 25 | <html> |
|
26 | 26 | <head> |
|
27 | <link rel="icon" href="/static/hgicon.png" type="image/png"> | |
|
27 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | |
|
28 | 28 | <meta name="robots" content="index, nofollow" /> |
|
29 | 29 | <link rel="stylesheet" href="/static/style.css" type="text/css" /> |
|
30 | 30 |
@@ -125,6 +125,18 b' python mkmsg2.py | hg --cwd b import -' | |||
|
125 | 125 | hg --cwd b tip --template '{desc}\n' |
|
126 | 126 | rm -r b |
|
127 | 127 | |
|
128 | # We weren't backing up the correct dirstate file when importing many patches | |
|
129 | # (issue963) | |
|
130 | echo '% import patch1 patch2; rollback' | |
|
131 | echo line 3 >> a/a | |
|
132 | hg --cwd a ci -m'third change' | |
|
133 | hg --cwd a export -o '../patch%R' 1 2 | |
|
134 | hg clone -qr0 a b | |
|
135 | hg --cwd b parents --template 'parent: #rev#\n' | |
|
136 | hg --cwd b import ../patch1 ../patch2 | |
|
137 | hg --cwd b rollback | |
|
138 | hg --cwd b parents --template 'parent: #rev#\n' | |
|
139 | rm -r b | |
|
128 | 140 | |
|
129 | 141 | # bug non regression test |
|
130 | 142 | # importing a patch in a subdirectory failed at the commit stage |
@@ -152,6 +152,12 b' email patch' | |||
|
152 | 152 | |
|
153 | 153 | next line |
|
154 | 154 | --- |
|
155 | % import patch1 patch2; rollback | |
|
156 | parent: 0 | |
|
157 | applying ../patch1 | |
|
158 | applying ../patch2 | |
|
159 | rolling back last transaction | |
|
160 | parent: 1 | |
|
155 | 161 | % hg import in a subdirectory |
|
156 | 162 | requesting all changes |
|
157 | 163 | adding changesets |
@@ -42,6 +42,12 b' echo % qinit -c' | |||
|
42 | 42 | hg --cwd c qinit -c |
|
43 | 43 | hg -R c/.hg/patches st |
|
44 | 44 | |
|
45 | echo % qnew should refuse bad patch names | |
|
46 | hg -R c qnew series | |
|
47 | hg -R c qnew status | |
|
48 | hg -R c qnew guards | |
|
49 | hg -R c qnew .hgignore | |
|
50 | ||
|
45 | 51 | echo % qnew implies add |
|
46 | 52 | |
|
47 | 53 | hg -R c qnew test.patch |
@@ -297,6 +303,13 b' hg st' | |||
|
297 | 303 | echo % mq tags |
|
298 | 304 | hg log --template '{rev} {tags}\n' -r qparent:qtip |
|
299 | 305 | |
|
306 | echo % bad node in status | |
|
307 | hg qpop | |
|
308 | hg strip -qn tip | |
|
309 | hg tip 2>&1 | sed -e 's/unknown node .*/unknown node/' | |
|
310 | hg branches 2>&1 | sed -e 's/unknown node .*/unknown node/' | |
|
311 | hg qpop | |
|
312 | ||
|
300 | 313 | cat >>$HGRCPATH <<EOF |
|
301 | 314 | [diff] |
|
302 | 315 | git = True |
@@ -59,6 +59,11 b' adding b/z' | |||
|
59 | 59 | % qinit -c |
|
60 | 60 | A .hgignore |
|
61 | 61 | A series |
|
62 | % qnew should refuse bad patch names | |
|
63 | abort: "series" cannot be used as the name of a patch | |
|
64 | abort: "status" cannot be used as the name of a patch | |
|
65 | abort: "guards" cannot be used as the name of a patch | |
|
66 | abort: ".hgignore" cannot be used as the name of a patch | |
|
62 | 67 | % qnew implies add |
|
63 | 68 | A .hgignore |
|
64 | 69 | A series |
@@ -281,6 +286,18 b' Errors during apply, please fix and refr' | |||
|
281 | 286 | 0 qparent |
|
282 | 287 | 1 qbase foo |
|
283 | 288 | 2 qtip bar tip |
|
289 | % bad node in status | |
|
290 | Now at: foo | |
|
291 | changeset: 0:cb9a9f314b8b | |
|
292 | mq status file refers to unknown node | |
|
293 | tag: tip | |
|
294 | user: test | |
|
295 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
296 | summary: a | |
|
297 | ||
|
298 | mq status file refers to unknown node | |
|
299 | default 0:cb9a9f314b8b | |
|
300 | abort: working directory revision is not qtip | |
|
284 | 301 | new file |
|
285 | 302 | |
|
286 | 303 | diff --git a/new b/new |
@@ -41,6 +41,15 b' echo corrupted > .hg/branch.cache' | |||
|
41 | 41 | hg log -qr foo |
|
42 | 42 | cat .hg/branch.cache |
|
43 | 43 | |
|
44 | echo % push should update the branch cache | |
|
45 | hg init ../target | |
|
46 | echo % pushing just rev 0 | |
|
47 | hg push -qr 0 ../target | |
|
48 | cat ../target/.hg/branch.cache | |
|
49 | echo % pushing everything | |
|
50 | hg push -qf ../target | |
|
51 | cat ../target/.hg/branch.cache | |
|
52 | ||
|
44 | 53 | echo % update with no arguments: tipmost revision of the current branch |
|
45 | 54 | hg up -q -C 0 |
|
46 | 55 | hg up -q |
@@ -83,6 +83,15 b' 4909a3732169c0c20011c4f4b8fdff4e3d89b23f' | |||
|
83 | 83 | bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default |
|
84 | 84 | 4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo |
|
85 | 85 | 67ec16bde7f1575d523313b9bca000f6a6f12dca bar |
|
86 | % push should update the branch cache | |
|
87 | % pushing just rev 0 | |
|
88 | be8523e69bf892e25817fc97187516b3c0804ae4 0 | |
|
89 | be8523e69bf892e25817fc97187516b3c0804ae4 default | |
|
90 | % pushing everything | |
|
91 | 4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4 | |
|
92 | bf1bc2f45e834c75404d0ddab57d53beab56e2f8 default | |
|
93 | 4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo | |
|
94 | 67ec16bde7f1575d523313b9bca000f6a6f12dca bar | |
|
86 | 95 | % update with no arguments: tipmost revision of the current branch |
|
87 | 96 | bf1bc2f45e83 |
|
88 | 97 | 4909a3732169 (foo) tip |
@@ -27,6 +27,11 b' r = os.system(sys.argv[2])' | |||
|
27 | 27 | sys.exit(bool(r)) |
|
28 | 28 | EOF |
|
29 | 29 | |
|
30 | cat <<EOF > badhook | |
|
31 | import sys | |
|
32 | sys.stdout.write("KABOOM") | |
|
33 | EOF | |
|
34 | ||
|
30 | 35 | echo "# creating 'remote'" |
|
31 | 36 | hg init remote |
|
32 | 37 | cd remote |
@@ -91,13 +96,16 b' hg cat -r tip foo' | |||
|
91 | 96 | |
|
92 | 97 | echo z > z |
|
93 | 98 | hg ci -A -m z -d '1000001 0' z |
|
99 | # a bad, evil hook that prints to stdout | |
|
100 | echo 'changegroup.stdout = python ../badhook' >> .hg/hgrc | |
|
94 | 101 | |
|
95 | 102 | cd ../local |
|
96 | 103 | echo r > r |
|
97 | 104 | hg ci -A -m z -d '1000002 0' r |
|
98 | 105 | |
|
99 | echo "# push should succeed" | |
|
106 | echo "# push should succeed even though it has an unexpected response" | |
|
100 | 107 | hg push |
|
108 | hg -R ../remote heads | |
|
101 | 109 | |
|
102 | 110 | cd .. |
|
103 | 111 | cat dummylog |
@@ -70,7 +70,7 b' crosschecking files in changesets and ma' | |||
|
70 | 70 | checking files |
|
71 | 71 | 2 files, 2 changesets, 3 total revisions |
|
72 | 72 | bleah |
|
73 | # push should succeed | |
|
73 | # push should succeed even though it has an unexpected response | |
|
74 | 74 | pushing to ssh://user@dummy/remote |
|
75 | 75 | searching for changes |
|
76 | 76 | note: unsynced remote changes! |
@@ -78,6 +78,21 b' remote: adding changesets' | |||
|
78 | 78 | remote: adding manifests |
|
79 | 79 | remote: adding file changes |
|
80 | 80 | remote: added 1 changesets with 1 changes to 1 files |
|
81 | abort: unexpected response: | |
|
82 | 'KABOOM1\n' | |
|
83 | changeset: 3:ac7448082955 | |
|
84 | tag: tip | |
|
85 | parent: 1:572896fe480d | |
|
86 | user: test | |
|
87 | date: Mon Jan 12 13:46:42 1970 +0000 | |
|
88 | summary: z | |
|
89 | ||
|
90 | changeset: 2:187c6caa0d1e | |
|
91 | parent: 0:e34318c26897 | |
|
92 | user: test | |
|
93 | date: Mon Jan 12 13:46:41 1970 +0000 | |
|
94 | summary: z | |
|
95 | ||
|
81 | 96 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio |
|
82 | 97 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
83 | 98 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
General Comments 0
You need to be logged in to leave comments.
Login now