--- a/contrib/convert-repo
+++ b/contrib/convert-repo
@@ -73,7 +73,7 @@ class convert_git:
if n == "parent": parents.append(v)
tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
- tz = int(tzs) * (int(tzh) * 3600 + int(tzm))
+ tz = -int(tzs) * (int(tzh) * 3600 + int(tzm))
date = tm + " " + str(tz)
return (parents, author, date, message)
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1108,7 +1108,8 @@ def refresh(ui, repo, **opts):
def diff(ui, repo, *files, **opts):
"""diff of the current patch"""
- repomap[repo].diff(repo, files)
+ # deep in the dirstate code, the walkhelper method wants a list, not a tuple
+ repomap[repo].diff(repo, list(files))
return 0
def lastsavename(path):
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3249,11 +3249,9 @@ def parse(ui, args):
return (cmd, cmd and i[0] or None, args, options, cmdoptions)
def dispatch(args):
- signal.signal(signal.SIGTERM, catchterm)
- try:
- signal.signal(signal.SIGHUP, catchterm)
- except AttributeError:
- pass
+ for name in 'SIGTERM', 'SIGHUP', 'SIGBREAK':
+ num = getattr(signal, name, None)
+ if num: signal.signal(num, catchterm)
try:
u = ui.ui()
--- a/mercurial/hgweb.py
+++ b/mercurial/hgweb.py
@@ -419,7 +419,8 @@ class hgweb(object):
mt = mimetypes.guess_type(f)[0]
rawtext = text
if util.binary(text):
- text = "(binary:%s)" % mt
+ text = "(binary:%s)" % (mt or 'data')
+ mt = mt or 'text/plain'
def lines():
for l, t in enumerate(text.splitlines(1)):
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -20,8 +20,12 @@ def pipefilter(s, cmd):
'''filter string S through command CMD, returning its output'''
(pout, pin) = popen2.popen2(cmd, -1, 'b')
def writer():
- pin.write(s)
- pin.close()
+ try:
+ pin.write(s)
+ pin.close()
+ except IOError, inst:
+ if inst.errno != errno.EPIPE:
+ raise
# we should use select instead on UNIX, but this will work on most
# systems, including Windows
deleted file mode 100644
--- a/templates/filerevision-raw.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-Context-type: #mimetype#
-Content-disposition: filename=#file#
-
-#raw#
--- a/templates/map-raw
+++ b/templates/map-raw
@@ -8,7 +8,7 @@ diffline = '#line#'
changesetparent = '# parent: #node#'
changesetchild = '# child: #node#'
filenodelink = ''
-filerevision = filerevision-raw.tmpl
+filerevision = 'Content-Type: #mimetype#\nContent-Disposition: filename=#file#\n\n#raw#'
fileline = '#line#'
diffblock = '#lines#'
filediff = filediff-raw.tmpl