##// END OF EJS Templates
merge with crew
Benoit Boissinot -
r2451:134227b8 merge default
parent child Browse files
Show More
@@ -217,7 +217,14 b' def patchbomb(ui, repo, *revs, **opts):'
217 if not opts['test'] and not opts['mbox']:
217 if not opts['test'] and not opts['mbox']:
218 mail = ui.sendmail()
218 mail = ui.sendmail()
219 parent = None
219 parent = None
220 tz = time.strftime('%z')
220
221 # Calculate UTC offset
222 if time.daylight: offset = time.altzone
223 else: offset = time.timezone
224 if offset <= 0: sign, offset = '+', -offset
225 else: sign = '-'
226 offset = '%s%02d%02d' % (sign, offset / 3600, (offset % 3600) / 60)
227
221 sender_addr = email.Utils.parseaddr(sender)[1]
228 sender_addr = email.Utils.parseaddr(sender)[1]
222 for m in msgs:
229 for m in msgs:
223 try:
230 try:
@@ -228,7 +235,8 b' def patchbomb(ui, repo, *revs, **opts):'
228 m['In-Reply-To'] = parent
235 m['In-Reply-To'] = parent
229 else:
236 else:
230 parent = m['Message-Id']
237 parent = m['Message-Id']
231 m['Date'] = time.strftime('%a, %e %b %Y %T ', time.localtime(start_time)) + tz
238 m['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime(start_time)) + ' ' + offset
239
232 start_time += 1
240 start_time += 1
233 m['From'] = sender
241 m['From'] = sender
234 m['To'] = ', '.join(to)
242 m['To'] = ', '.join(to)
@@ -471,7 +471,7 b' class dirstate(object):'
471 # check the common case first
471 # check the common case first
472 if type_ == 'n':
472 if type_ == 'n':
473 if not st:
473 if not st:
474 st = os.stat(self.wjoin(fn))
474 st = os.lstat(self.wjoin(fn))
475 if size >= 0 and (size != st.st_size
475 if size >= 0 and (size != st.st_size
476 or (mode ^ st.st_mode) & 0100):
476 or (mode ^ st.st_mode) & 0100):
477 modified.append(fn)
477 modified.append(fn)
@@ -12,13 +12,13 b' from demandload import *'
12 demandload(globals(), "hg os urllib urllib2 urlparse zlib util httplib")
12 demandload(globals(), "hg os urllib urllib2 urlparse zlib util httplib")
13 demandload(globals(), "keepalive")
13 demandload(globals(), "keepalive")
14
14
15 class passwordmgr(urllib2.HTTPPasswordMgr):
15 class passwordmgr(urllib2.HTTPPasswordMgrWithDefaultRealm):
16 def __init__(self, ui):
16 def __init__(self, ui):
17 urllib2.HTTPPasswordMgr.__init__(self)
17 urllib2.HTTPPasswordMgrWithDefaultRealm.__init__(self)
18 self.ui = ui
18 self.ui = ui
19
19
20 def find_user_password(self, realm, authuri):
20 def find_user_password(self, realm, authuri):
21 authinfo = urllib2.HTTPPasswordMgr.find_user_password(
21 authinfo = urllib2.HTTPPasswordMgrWithDefaultRealm.find_user_password(
22 self, realm, authuri)
22 self, realm, authuri)
23 if authinfo != (None, None):
23 if authinfo != (None, None):
24 return authinfo
24 return authinfo
@@ -133,7 +133,8 b' class httprepository(remoterepository):'
133
133
134 passmgr = passwordmgr(ui)
134 passmgr = passwordmgr(ui)
135 if user:
135 if user:
136 ui.debug(_('will use user %s for http auth\n') % user)
136 ui.debug(_('will use user %s, password %s for http auth\n') %
137 (user, '*' * len(passwd)))
137 passmgr.add_password(None, host, user, passwd or '')
138 passmgr.add_password(None, host, user, passwd or '')
138
139
139 opener = urllib2.build_opener(
140 opener = urllib2.build_opener(
@@ -99,7 +99,7 b' EXTRA ATTRIBUTES AND METHODS'
99
99
100 """
100 """
101
101
102 # $Id: keepalive.py,v 1.13 2005/10/22 21:57:28 mstenner Exp $
102 # $Id: keepalive.py,v 1.14 2006/04/04 21:00:32 mstenner Exp $
103
103
104 import urllib2
104 import urllib2
105 import httplib
105 import httplib
@@ -249,12 +249,14 b' class HTTPHandler(urllib2.HTTPHandler):'
249 r._url = req.get_full_url()
249 r._url = req.get_full_url()
250 r._connection = h
250 r._connection = h
251 r.code = r.status
251 r.code = r.status
252 r.headers = r.msg
253 r.msg = r.reason
252
254
253 if r.status == 200 or not HANDLE_ERRORS:
255 if r.status == 200 or not HANDLE_ERRORS:
254 return r
256 return r
255 else:
257 else:
256 return self.parent.error('http', req, r, r.status, r.reason, r.msg)
258 return self.parent.error('http', req, r,
257
259 r.status, r.msg, r.headers)
258
260
259 def _reuse_connection(self, h, req, host):
261 def _reuse_connection(self, h, req, host):
260 """start the transaction with a re-used connection
262 """start the transaction with a re-used connection
@@ -371,7 +373,7 b' class HTTPResponse(httplib.HTTPResponse)'
371 self.close()
373 self.close()
372
374
373 def info(self):
375 def info(self):
374 return self.msg
376 return self.headers
375
377
376 def geturl(self):
378 def geturl(self):
377 return self._url
379 return self._url
@@ -242,7 +242,7 b' class localrepository(object):'
242 raise repo.RepoError(_("unknown revision '%s'") % key)
242 raise repo.RepoError(_("unknown revision '%s'") % key)
243
243
244 def dev(self):
244 def dev(self):
245 return os.stat(self.path).st_dev
245 return os.lstat(self.path).st_dev
246
246
247 def local(self):
247 def local(self):
248 return True
248 return True
@@ -474,7 +474,7 b' def _readlock_file(pathname):'
474
474
475 def nlinks(pathname):
475 def nlinks(pathname):
476 """Return number of hardlinks for the given file."""
476 """Return number of hardlinks for the given file."""
477 return os.stat(pathname).st_nlink
477 return os.lstat(pathname).st_nlink
478
478
479 if hasattr(os, 'link'):
479 if hasattr(os, 'link'):
480 os_link = os.link
480 os_link = os.link
@@ -625,10 +625,10 b' else:'
625
625
626 def is_exec(f, last):
626 def is_exec(f, last):
627 """check whether a file is executable"""
627 """check whether a file is executable"""
628 return (os.stat(f).st_mode & 0100 != 0)
628 return (os.lstat(f).st_mode & 0100 != 0)
629
629
630 def set_exec(f, mode):
630 def set_exec(f, mode):
631 s = os.stat(f).st_mode
631 s = os.lstat(f).st_mode
632 if (s & 0100 != 0) == mode:
632 if (s & 0100 != 0) == mode:
633 return
633 return
634 if mode:
634 if mode:
@@ -162,7 +162,7 b' def nlinks(pathname):'
162 fh.Close()
162 fh.Close()
163 return res[7]
163 return res[7]
164 except pywintypes.error:
164 except pywintypes.error:
165 return os.stat(pathname).st_nlink
165 return os.lstat(pathname).st_nlink
166
166
167 def testpid(pid):
167 def testpid(pid):
168 '''return True if pid is still running or unable to
168 '''return True if pid is still running or unable to
@@ -2,8 +2,4 b' abort: error: Connection refused'
2 255
2 255
3 copy: No such file or directory
3 copy: No such file or directory
4 abort: HTTP Error 404
4 abort: HTTP Error 404
5 Date:
6 Content-Type: text/html
7 Connection: close
8
9 0
5 0
General Comments 0
You need to be logged in to leave comments. Login now