# HG changeset patch # User Benoit Boissinot # Date 1150562164 -7200 # Node ID 134227b82a963ea0adc172c1ad169dc0bbfef53f # Parent b93cab5ed77651d097256da6f610c425cfd50f73# Parent b77a2ef61b81a7cdaa70bb68f0b66860b86c0e81 merge with crew diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -217,7 +217,14 @@ def patchbomb(ui, repo, *revs, **opts): if not opts['test'] and not opts['mbox']: mail = ui.sendmail() parent = None - tz = time.strftime('%z') + + # Calculate UTC offset + if time.daylight: offset = time.altzone + else: offset = time.timezone + if offset <= 0: sign, offset = '+', -offset + else: sign = '-' + offset = '%s%02d%02d' % (sign, offset / 3600, (offset % 3600) / 60) + sender_addr = email.Utils.parseaddr(sender)[1] for m in msgs: try: @@ -228,7 +235,8 @@ def patchbomb(ui, repo, *revs, **opts): m['In-Reply-To'] = parent else: parent = m['Message-Id'] - m['Date'] = time.strftime('%a, %e %b %Y %T ', time.localtime(start_time)) + tz + m['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime(start_time)) + ' ' + offset + start_time += 1 m['From'] = sender m['To'] = ', '.join(to) diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -471,7 +471,7 @@ class dirstate(object): # check the common case first if type_ == 'n': if not st: - st = os.stat(self.wjoin(fn)) + st = os.lstat(self.wjoin(fn)) if size >= 0 and (size != st.st_size or (mode ^ st.st_mode) & 0100): modified.append(fn) diff --git a/mercurial/httprepo.py b/mercurial/httprepo.py --- a/mercurial/httprepo.py +++ b/mercurial/httprepo.py @@ -12,13 +12,13 @@ from demandload import * demandload(globals(), "hg os urllib urllib2 urlparse zlib util httplib") demandload(globals(), "keepalive") -class passwordmgr(urllib2.HTTPPasswordMgr): +class passwordmgr(urllib2.HTTPPasswordMgrWithDefaultRealm): def __init__(self, ui): - urllib2.HTTPPasswordMgr.__init__(self) + urllib2.HTTPPasswordMgrWithDefaultRealm.__init__(self) self.ui = ui def find_user_password(self, realm, authuri): - authinfo = urllib2.HTTPPasswordMgr.find_user_password( + authinfo = urllib2.HTTPPasswordMgrWithDefaultRealm.find_user_password( self, realm, authuri) if authinfo != (None, None): return authinfo @@ -133,7 +133,8 @@ class httprepository(remoterepository): passmgr = passwordmgr(ui) if user: - ui.debug(_('will use user %s for http auth\n') % user) + ui.debug(_('will use user %s, password %s for http auth\n') % + (user, '*' * len(passwd))) passmgr.add_password(None, host, user, passwd or '') opener = urllib2.build_opener( diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py --- a/mercurial/keepalive.py +++ b/mercurial/keepalive.py @@ -99,7 +99,7 @@ EXTRA ATTRIBUTES AND METHODS """ -# $Id: keepalive.py,v 1.13 2005/10/22 21:57:28 mstenner Exp $ +# $Id: keepalive.py,v 1.14 2006/04/04 21:00:32 mstenner Exp $ import urllib2 import httplib @@ -249,12 +249,14 @@ class HTTPHandler(urllib2.HTTPHandler): r._url = req.get_full_url() r._connection = h r.code = r.status + r.headers = r.msg + r.msg = r.reason if r.status == 200 or not HANDLE_ERRORS: return r else: - return self.parent.error('http', req, r, r.status, r.reason, r.msg) - + return self.parent.error('http', req, r, + r.status, r.msg, r.headers) def _reuse_connection(self, h, req, host): """start the transaction with a re-used connection @@ -371,7 +373,7 @@ class HTTPResponse(httplib.HTTPResponse) self.close() def info(self): - return self.msg + return self.headers def geturl(self): return self._url diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -242,7 +242,7 @@ class localrepository(object): raise repo.RepoError(_("unknown revision '%s'") % key) def dev(self): - return os.stat(self.path).st_dev + return os.lstat(self.path).st_dev def local(self): return True diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -474,7 +474,7 @@ def _readlock_file(pathname): def nlinks(pathname): """Return number of hardlinks for the given file.""" - return os.stat(pathname).st_nlink + return os.lstat(pathname).st_nlink if hasattr(os, 'link'): os_link = os.link @@ -625,10 +625,10 @@ else: def is_exec(f, last): """check whether a file is executable""" - return (os.stat(f).st_mode & 0100 != 0) + return (os.lstat(f).st_mode & 0100 != 0) def set_exec(f, mode): - s = os.stat(f).st_mode + s = os.lstat(f).st_mode if (s & 0100 != 0) == mode: return if mode: diff --git a/mercurial/util_win32.py b/mercurial/util_win32.py --- a/mercurial/util_win32.py +++ b/mercurial/util_win32.py @@ -162,7 +162,7 @@ def nlinks(pathname): fh.Close() return res[7] except pywintypes.error: - return os.stat(pathname).st_nlink + return os.lstat(pathname).st_nlink def testpid(pid): '''return True if pid is still running or unable to diff --git a/tests/test-bad-pull.out b/tests/test-bad-pull.out --- a/tests/test-bad-pull.out +++ b/tests/test-bad-pull.out @@ -2,8 +2,4 @@ abort: error: Connection refused 255 copy: No such file or directory abort: HTTP Error 404 -Date: -Content-Type: text/html -Connection: close - 0