# HG changeset patch # User Dirkjan Ochtman # Date 1249482777 -7200 # Node ID 93a8be83ec09d808c77719abbf0de472f2eb84a8 # Parent 23cf7b52785a3ae06a5236b2a9b643d6e42f9345# Parent 8c1df18452aa747772d827e67b68135d3950c5bf merge backout of 5724cd7b3688 diff -r 8c1df18452aa -r 93a8be83ec09 hgext/color.py --- a/hgext/color.py Wed Aug 05 16:32:38 2009 +0200 +++ b/hgext/color.py Wed Aug 05 16:32:57 2009 +0200 @@ -59,6 +59,7 @@ ''' import os, sys +import itertools from mercurial import cmdutil, commands, extensions, error from mercurial.i18n import _ @@ -142,14 +143,10 @@ '''run the qseries command with colored output''' ui.pushbuffer() retval = orig(ui, repo, **opts) - patches = ui.popbuffer().splitlines() - for patch in patches: - patchname = patch - if opts['summary']: - patchname = patchname.split(': ', 1)[0] - if ui.verbose: - patchname = patchname.lstrip().split(' ', 2)[-1] + patchlines = ui.popbuffer().splitlines() + patchnames = repo.mq.series + for patch, patchname in itertools.izip(patchlines, patchnames): if opts['missing']: effects = _patch_effects['missing'] # Determine if patch is applied. diff -r 8c1df18452aa -r 93a8be83ec09 hgext/convert/subversion.py --- a/hgext/convert/subversion.py Wed Aug 05 16:32:38 2009 +0200 +++ b/hgext/convert/subversion.py Wed Aug 05 16:32:57 2009 +0200 @@ -311,7 +311,7 @@ self.module += '/' + trunk self.head = self.latest(self.module, self.last_changed) if not self.head: - raise util.Abort(_('no revision found in module %s') + raise util.Abort(_('no revision found in module %s') % self.module) # First head in the list is the module's head @@ -454,8 +454,8 @@ # Here/tags/tag.1 discarded as well as its children. # It happens with tools like cvs2svn. Such tags cannot # be represented in mercurial. - addeds = dict((p, e.copyfrom_path) for p, e - in origpaths.iteritems() + addeds = dict((p, e.copyfrom_path) for p, e + in origpaths.iteritems() if e.action == 'A' and e.copyfrom_path) badroots = set() for destroot in addeds: diff -r 8c1df18452aa -r 93a8be83ec09 hgext/notify.py --- a/hgext/notify.py Wed Aug 05 16:32:38 2009 +0200 +++ b/hgext/notify.py Wed Aug 05 16:32:57 2009 +0200 @@ -70,7 +70,7 @@ from mercurial.i18n import _ from mercurial import patch, cmdutil, templater, util, mail -import email.Parser, fnmatch, socket, time +import email.Parser, email.Errors, fnmatch, socket, time # template for single changeset can include email headers. single_template = ''' @@ -180,20 +180,25 @@ '''send message.''' p = email.Parser.Parser() - msg = p.parsestr(data) + try: + msg = p.parsestr(data) + except email.Errors.MessageParseError, inst: + raise util.Abort(inst) # store sender and subject sender, subject = msg['From'], msg['Subject'] del msg['From'], msg['Subject'] - # store remaining headers - headers = msg.items() - # create fresh mime message from msg body - text = msg.get_payload() - # for notification prefer readability over data precision - msg = mail.mimeencode(self.ui, text, self.charsets, self.test) - # reinstate custom headers - for k, v in headers: - msg[k] = v + + if not msg.is_multipart(): + # create fresh mime message from scratch + # (multipart templates must take care of this themselves) + headers = msg.items() + payload = msg.get_payload() + # for notification prefer readability over data precision + msg = mail.mimeencode(self.ui, payload, self.charsets, self.test) + # reinstate custom headers + for k, v in headers: + msg[k] = v msg['Date'] = util.datestr(format="%a, %d %b %Y %H:%M:%S %1%2") diff -r 8c1df18452aa -r 93a8be83ec09 mercurial/demandimport.py --- a/mercurial/demandimport.py Wed Aug 05 16:32:38 2009 +0200 +++ b/mercurial/demandimport.py Wed Aug 05 16:32:57 2009 +0200 @@ -81,7 +81,10 @@ def _demandimport(name, globals=None, locals=None, fromlist=None, level=None): if not locals or name in ignore or fromlist == ('*',): # these cases we can't really delay - return _origimport(name, globals, locals, fromlist) + if level is None: + return _origimport(name, globals, locals, fromlist) + else: + return _origimport(name, globals, locals, fromlist, level) elif not fromlist: # import a [as b] if '.' in name: # a.b diff -r 8c1df18452aa -r 93a8be83ec09 mercurial/lsprof.py --- a/mercurial/lsprof.py Wed Aug 05 16:32:38 2009 +0200 +++ b/mercurial/lsprof.py Wed Aug 05 16:32:57 2009 +0200 @@ -85,7 +85,7 @@ try: mname = _fn2mod[code.co_filename] except KeyError: - for k, v in sys.modules.iteritems(): + for k, v in list(sys.modules.iteritems()): if v is None: continue if not hasattr(v, '__file__'): diff -r 8c1df18452aa -r 93a8be83ec09 mercurial/tags.py --- a/mercurial/tags.py Wed Aug 05 16:32:38 2009 +0200 +++ b/mercurial/tags.py Wed Aug 05 16:32:57 2009 +0200 @@ -210,7 +210,7 @@ # have no . The cache is ordered from tip to oldest (which # is part of why is there: a quick visual check is all # that's required to ensure correct order). - # + # # This information is enough to let us avoid the most expensive part # of finding global tags, which is looking up in the # manifest for each head. @@ -243,9 +243,8 @@ return (None, None, tags, False) if cachefile: cachefile.close() # ignore rest of file - + repoheads = repo.heads() - # Case 2 (uncommon): empty repo; get out quickly and don't bother # writing an empty cache. if repoheads == [nullid]: diff -r 8c1df18452aa -r 93a8be83ec09 mercurial/ui.py --- a/mercurial/ui.py Wed Aug 05 16:32:38 2009 +0200 +++ b/mercurial/ui.py Wed Aug 05 16:32:57 2009 +0200 @@ -288,7 +288,7 @@ """Prompt user with msg, read response, and ensure it matches one of the provided choices. The index of the choice is returned. choices is a sequence of acceptable responses with the format: - ('&None', 'E&xec', 'Sym&link') Responses are case insensitive. + ('&None', 'E&xec', 'Sym&link') Responses are case insensitive. If ui is not interactive, the default is returned. """ resps = [s[s.index('&')+1].lower() for s in choices]