changeset 4222:2792dbd648c7

Merge with mpm
author Brendan Cully <brendan@kublai.com>
date Wed, 14 Mar 2007 18:01:24 -0700
parents 0a95d0e83b4c (diff) 5ccbc0be6cdb (current diff)
children 6af3df7822ed
files
diffstat 5 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Wed Mar 14 19:17:40 2007 -0500
+++ b/hgext/mq.py	Wed Mar 14 18:01:24 2007 -0700
@@ -2085,14 +2085,15 @@
             if not q.applied:
                 return tagscache
 
-            mqtags = [(patch.rev, patch.name) for patch in q.applied]
+            mqtags = [(revlog.bin(patch.rev), patch.name) for patch in q.applied]
             mqtags.append((mqtags[-1][0], 'qtip'))
             mqtags.append((mqtags[0][0], 'qbase'))
+            mqtags.append((self.changelog.parents(mqtags[0][0])[0], 'qparent'))
             for patch in mqtags:
                 if patch[1] in tagscache:
                     self.ui.warn('Tag %s overrides mq patch of the same name\n' % patch[1])
                 else:
-                    tagscache[patch[1]] = revlog.bin(patch[0])
+                    tagscache[patch[1]] = patch[0]
 
             return tagscache
 
--- a/mercurial/patch.py	Wed Mar 14 19:17:40 2007 -0500
+++ b/mercurial/patch.py	Wed Mar 14 18:01:24 2007 -0700
@@ -48,8 +48,6 @@
     fd, tmpname = tempfile.mkstemp(prefix='hg-patch-')
     tmpfp = os.fdopen(fd, 'w')
     try:
-        hgpatch = False
-
         msg = email.Parser.Parser().parse(fileobj)
 
         message = msg['Subject']
@@ -77,6 +75,9 @@
             payload = part.get_payload(decode=True)
             m = diffre.search(payload)
             if m:
+                hgpatch = False
+                ignoretext = False
+
                 ui.debug(_('found patch at byte %d\n') % m.start(0))
                 diffs_seen += 1
                 cfp = cStringIO.StringIO()
@@ -96,7 +97,9 @@
                             ui.debug('From: %s\n' % user)
                         elif line.startswith("# Date "):
                             date = line[7:]
-                    if not line.startswith('# '):
+                    elif line == '---' and 'git-send-email' in msg['X-Mailer']:
+                        ignoretext = True
+                    if not line.startswith('# ') and not ignoretext:
                         cfp.write(line)
                         cfp.write('\n')
                 message = cfp.getvalue()
--- a/mercurial/ui.py	Wed Mar 14 19:17:40 2007 -0500
+++ b/mercurial/ui.py	Wed Mar 14 18:01:24 2007 -0700
@@ -361,7 +361,7 @@
 
     def expandpath(self, loc, default=None):
         """Return repository location relative to cwd or from [paths]"""
-        if "://" in loc or os.path.isdir(loc):
+        if "://" in loc or os.path.isdir(os.path.join(loc, '.hg')):
             return loc
 
         path = self.config("paths", loc)
--- a/tests/test-mq	Wed Mar 14 19:17:40 2007 -0500
+++ b/tests/test-mq	Wed Mar 14 18:01:24 2007 -0700
@@ -262,6 +262,9 @@
 hg qpush -a
 hg st
 
+echo % mq tags
+hg log --template '{rev} {tags}\n' -r qparent:qtip
+
 cat >>$HGRCPATH <<EOF
 [diff]
 git = True
--- a/tests/test-mq.out	Wed Mar 14 19:17:40 2007 -0500
+++ b/tests/test-mq.out	Wed Mar 14 18:01:24 2007 -0700
@@ -265,6 +265,10 @@
 Errors during apply, please fix and refresh bar
 ? foo
 ? foo.rej
+% mq tags
+0 qparent
+1 qbase foo
+2 qtip bar tip
 new file
 
 diff --git a/new b/new