##// END OF EJS Templates
Merge with crew-stable
Alexis S. L. Carvalho -
r4134:9dc64c84 merge default
parent child Browse files
Show More
@@ -1738,7 +1738,10 b' def guard(ui, repo, *args, **opts):'
1738 if patch is None:
1738 if patch is None:
1739 raise util.Abort(_('no patch to work with'))
1739 raise util.Abort(_('no patch to work with'))
1740 if args or opts['none']:
1740 if args or opts['none']:
1741 q.set_guards(q.find_series(patch), args)
1741 idx = q.find_series(patch)
1742 if idx is None:
1743 raise util.Abort(_('no patch named %s') % patch)
1744 q.set_guards(idx, args)
1742 q.save_dirty()
1745 q.save_dirty()
1743 else:
1746 else:
1744 status(q.series.index(q.lookup(patch)))
1747 status(q.series.index(q.lookup(patch)))
@@ -255,8 +255,8 b' static struct hunklist diff(struct line '
255 if (pos && l.base && t) {
255 if (pos && l.base && t) {
256 /* generate the matching block list */
256 /* generate the matching block list */
257 recurse(a, b, pos, 0, an, 0, bn, &l);
257 recurse(a, b, pos, 0, an, 0, bn, &l);
258 l.head->a1 = an;
258 l.head->a1 = l.head->a2 = an;
259 l.head->b1 = bn;
259 l.head->b1 = l.head->b2 = bn;
260 l.head++;
260 l.head++;
261 }
261 }
262
262
@@ -197,6 +197,11 b' def create_server(ui, repo):'
197 pass
197 pass
198
198
199 class MercurialHTTPServer(object, _mixin, BaseHTTPServer.HTTPServer):
199 class MercurialHTTPServer(object, _mixin, BaseHTTPServer.HTTPServer):
200
201 # SO_REUSEADDR has broken semantics on windows
202 if os.name == 'nt':
203 allow_reuse_address = 0
204
200 def __init__(self, *args, **kargs):
205 def __init__(self, *args, **kargs):
201 BaseHTTPServer.HTTPServer.__init__(self, *args, **kargs)
206 BaseHTTPServer.HTTPServer.__init__(self, *args, **kargs)
202 self.accesslog = accesslog
207 self.accesslog = accesslog
@@ -126,6 +126,7 b' class httprepository(remoterepository):'
126 def __init__(self, ui, path):
126 def __init__(self, ui, path):
127 self.path = path
127 self.path = path
128 self.caps = None
128 self.caps = None
129 self.handler = None
129 scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path)
130 scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path)
130 if query or frag:
131 if query or frag:
131 raise util.Abort(_('unsupported URL component: "%s"') %
132 raise util.Abort(_('unsupported URL component: "%s"') %
@@ -140,7 +141,8 b' class httprepository(remoterepository):'
140
141
141 proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy')
142 proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy')
142 # XXX proxyauthinfo = None
143 # XXX proxyauthinfo = None
143 handlers = [httphandler()]
144 self.handler = httphandler()
145 handlers = [self.handler]
144
146
145 if proxyurl:
147 if proxyurl:
146 # proxy can be proper url or host[:port]
148 # proxy can be proper url or host[:port]
@@ -198,6 +200,11 b' class httprepository(remoterepository):'
198 # 1.0 here is the _protocol_ version
200 # 1.0 here is the _protocol_ version
199 opener.addheaders = [('User-agent', 'mercurial/proto-1.0')]
201 opener.addheaders = [('User-agent', 'mercurial/proto-1.0')]
200 urllib2.install_opener(opener)
202 urllib2.install_opener(opener)
203
204 def __del__(self):
205 if self.handler:
206 self.handler.close_all()
207 self.handler = None
201
208
202 def url(self):
209 def url(self):
203 return self.path
210 return self.path
@@ -1880,6 +1880,8 b' class localrepository(repo.repository):'
1880 ofp.write(chunk)
1880 ofp.write(chunk)
1881 ofp.close()
1881 ofp.close()
1882 elapsed = time.time() - start
1882 elapsed = time.time() - start
1883 if elapsed <= 0:
1884 elapsed = 0.001
1883 self.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') %
1885 self.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') %
1884 (util.bytecount(total_bytes), elapsed,
1886 (util.bytecount(total_bytes), elapsed,
1885 util.bytecount(total_bytes / elapsed)))
1887 util.bytecount(total_bytes / elapsed)))
@@ -78,7 +78,7 b' def stream_out(repo, fileobj):'
78 entries = []
78 entries = []
79 total_bytes = 0
79 total_bytes = 0
80 for name, size in walkrepo(repo.spath):
80 for name, size in walkrepo(repo.spath):
81 name = util.pconvert(repo.decodefn(name))
81 name = repo.decodefn(util.pconvert(name))
82 entries.append((name, size))
82 entries.append((name, size))
83 total_bytes += size
83 total_bytes += size
84 repolock.release()
84 repolock.release()
@@ -790,6 +790,14 b" if os.name == 'nt':"
790 if inst.errno != 0: raise
790 if inst.errno != 0: raise
791 self.close()
791 self.close()
792 raise IOError(errno.EPIPE, 'Broken pipe')
792 raise IOError(errno.EPIPE, 'Broken pipe')
793
794 def flush(self):
795 try:
796 return self.fp.flush()
797 except IOError, inst:
798 if inst.errno != errno.EINVAL: raise
799 self.close()
800 raise IOError(errno.EPIPE, 'Broken pipe')
793
801
794 sys.stdout = winstdout(sys.stdout)
802 sys.stdout = winstdout(sys.stdout)
795
803
@@ -6,6 +6,8 b' echo foo>foo'
6 hg commit -A -d '0 0' -m 1
6 hg commit -A -d '0 0' -m 1
7 hg --config server.uncompressed=True serve -p 20059 -d --pid-file=../hg1.pid
7 hg --config server.uncompressed=True serve -p 20059 -d --pid-file=../hg1.pid
8 hg serve -p 20060 -d --pid-file=../hg2.pid
8 hg serve -p 20060 -d --pid-file=../hg2.pid
9 # Test server address cannot be reused
10 hg serve -p 20060 2>&1 | sed -e 's/abort: cannot start server:.*/abort: cannot start server:/'
9 cd ..
11 cd ..
10 cat hg1.pid hg2.pid >> $DAEMON_PIDS
12 cat hg1.pid hg2.pid >> $DAEMON_PIDS
11
13
@@ -1,4 +1,5 b''
1 adding foo
1 adding foo
2 abort: cannot start server:
2 % clone via stream
3 % clone via stream
3 streaming all changes
4 streaming all changes
4 XXX files to transfer, XXX bytes of data
5 XXX files to transfer, XXX bytes of data
@@ -27,6 +27,9 b' hg qrefresh'
27 hg qpop -a
27 hg qpop -a
28
28
29 echo % should fail
29 echo % should fail
30 hg qguard does-not-exist.patch +bleh
31
32 echo % should fail
30 hg qguard +fail
33 hg qguard +fail
31
34
32 hg qpush
35 hg qpush
@@ -1,6 +1,8 b''
1 adding x
1 adding x
2 Patch queue now empty
2 Patch queue now empty
3 % should fail
3 % should fail
4 abort: no patch named does-not-exist.patch
5 % should fail
4 abort: no patches applied
6 abort: no patches applied
5 applying a.patch
7 applying a.patch
6 Now at: a.patch
8 Now at: a.patch
General Comments 0
You need to be logged in to leave comments. Login now