Merge with crew
authorMatt Mackall <mpm@selenic.com>
Mon, 27 Jul 2009 18:38:20 -0500
changeset 9248 ac02b43bc08a
parent 9247 5ee916274ce0 (current diff)
parent 9246 2de7d96593db (diff)
child 9282 f9087eea293a
child 9325 74e717a21779
Merge with crew
mercurial/hg.py
mercurial/patch.py
--- a/hgext/convert/darcs.py	Mon Jul 27 18:38:03 2009 -0500
+++ b/hgext/convert/darcs.py	Mon Jul 27 18:38:20 2009 -0500
@@ -36,6 +36,10 @@
             raise NoRepo("%s does not look like a darcs repo" % path)
 
         checktool('darcs')
+        version = self.run0('--version').splitlines()[0].strip()
+        if version < '2.1':
+            raise util.Abort(_('darcs version 2.1 or newer needed (found %r)') %
+                             version)
 
         if ElementTree is None:
             raise util.Abort(_("Python ElementTree module is not available"))
--- a/mercurial/hg.py	Mon Jul 27 18:38:03 2009 -0500
+++ b/mercurial/hg.py	Mon Jul 27 18:38:20 2009 -0500
@@ -138,7 +138,7 @@
             try:
                 uprev = r.lookup(test)
                 break
-            except:
+            except LookupError:
                 continue
         _update(r, uprev)
 
--- a/mercurial/mail.py	Mon Jul 27 18:38:03 2009 -0500
+++ b/mercurial/mail.py	Mon Jul 27 18:38:20 2009 -0500
@@ -36,7 +36,10 @@
     if username and password:
         ui.note(_('(authenticating to mail server as %s)\n') %
                   (username))
-        s.login(username, password)
+        try:
+            s.login(username, password)
+        except smtplib.SMTPException, inst:
+            raise util.Abort(inst)
 
     def send(sender, recipients, msg):
         try:
--- a/mercurial/patch.py	Mon Jul 27 18:38:03 2009 -0500
+++ b/mercurial/patch.py	Mon Jul 27 18:38:20 2009 -0500
@@ -182,6 +182,7 @@
     lineno = 0
     for line in lr:
         lineno += 1
+        line = line.rstrip(' \r\n')
         if line.startswith('diff --git'):
             m = gitre.match(line)
             if m:
@@ -200,23 +201,23 @@
                 continue
             if line.startswith('rename from '):
                 gp.op = 'RENAME'
-                gp.oldpath = line[12:].rstrip()
+                gp.oldpath = line[12:]
             elif line.startswith('rename to '):
-                gp.path = line[10:].rstrip()
+                gp.path = line[10:]
             elif line.startswith('copy from '):
                 gp.op = 'COPY'
-                gp.oldpath = line[10:].rstrip()
+                gp.oldpath = line[10:]
             elif line.startswith('copy to '):
-                gp.path = line[8:].rstrip()
+                gp.path = line[8:]
             elif line.startswith('deleted file'):
                 gp.op = 'DELETE'
                 # is the deleted file a symlink?
-                gp.setmode(int(line.rstrip()[-6:], 8))
+                gp.setmode(int(line[-6:], 8))
             elif line.startswith('new file mode '):
                 gp.op = 'ADD'
-                gp.setmode(int(line.rstrip()[-6:], 8))
+                gp.setmode(int(line[-6:], 8))
             elif line.startswith('new mode '):
-                gp.setmode(int(line.rstrip()[-6:], 8))
+                gp.setmode(int(line[-6:], 8))
             elif line.startswith('GIT binary patch'):
                 dopatch |= GP_BINARY
                 gp.binary = True
--- a/tests/hghave	Mon Jul 27 18:38:03 2009 -0500
+++ b/tests/hghave	Mon Jul 27 18:38:20 2009 -0500
@@ -39,7 +39,7 @@
     try:
         import bzrlib
         return (bzrlib.__doc__ != None
-                and bzrlib.version_info[:2] == (1, 14))
+                and bzrlib.version_info[:2] >= (1, 14))
     except ImportError:
         return False