# HG changeset patch # User Thomas Arendsen Hein # Date 1145475591 -7200 # Node ID 2b8f887b2d1d617443ad0085fa20ef3b2ed28cde # Parent cd7cb896396bca257f0f98318b009801380391a3# Parent 4d2c2597876fb1a5d55d3d0a6a99da3557e252ac Merge with crew diff --git a/contrib/convert-repo b/contrib/convert-repo --- 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) diff --git a/hgext/mq.py b/hgext/mq.py --- 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): diff --git a/mercurial/commands.py b/mercurial/commands.py --- 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() diff --git a/mercurial/hgweb.py b/mercurial/hgweb.py --- 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)): diff --git a/mercurial/util.py b/mercurial/util.py --- 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 diff --git a/templates/filerevision-raw.tmpl b/templates/filerevision-raw.tmpl deleted file mode 100644 --- a/templates/filerevision-raw.tmpl +++ /dev/null @@ -1,4 +0,0 @@ -Context-type: #mimetype# -Content-disposition: filename=#file# - -#raw# diff --git a/templates/map-raw b/templates/map-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