changeset 966:07473e474bc4

merge
author Siddharth Agarwal <sid0@fb.com>
date Thu, 31 Dec 2015 12:45:30 -0800
parents b867b5f0a63a (current diff) 06385a2b30f3 (diff)
children be627eeee5a9
files hggit/__init__.py hggit/git_handler.py hggit/gitdirstate.py hggit/overlay.py
diffstat 4 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py
+++ b/hggit/__init__.py
@@ -52,7 +52,7 @@
 try:
     from mercurial import exchange
     exchange.push  # existed in first iteration of this file
-except ImportError:
+except (AttributeError, ImportError):
     # We only *use* the exchange module in hg 3.2+, so this is safe
     pass
 
@@ -60,7 +60,7 @@
     from mercurial import ignore
     ignore.readpats
     ignoremod = True
-except ImportError:
+except (AttributeError, ImportError):
     # The ignore module disappeared in Mercurial 3.5
     ignoremod = False
 
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -1537,7 +1537,7 @@
             from mercurial import encoding
             old = encoding.encoding
             encoding.encoding = new_encoding
-        except ImportError:
+        except (AttributeError, ImportError):
             old = hgutil._encoding
             hgutil._encoding = new_encoding
         return old
--- a/hggit/gitdirstate.py
+++ b/hggit/gitdirstate.py
@@ -15,14 +15,14 @@
     from mercurial import ignore
     ignore.readpats
     ignoremod = True
-except ImportError:
+except (AttributeError, ImportError):
     # ignore module was removed in Mercurial 3.5
     ignoremod = False
 # pathauditor moved to pathutil in 2.8
 try:
     from mercurial import pathutil
     pathutil.pathauditor
-except ImportError:
+except (AttributeError, ImportError):
     pathutil = scmutil
 from mercurial.i18n import _
 
--- a/hggit/overlay.py
+++ b/hggit/overlay.py
@@ -242,7 +242,7 @@
         try:
             from mercurial import phases
             return phases.draft
-        except ImportError:
+        except (AttributeError, ImportError):
             return 1
 
     def totuple(self):
@@ -348,7 +348,7 @@
             # Mercurial >= 3.3
             from mercurial import namespaces
             self.names = namespaces.namespaces()
-        except ImportError:
+        except (AttributeError, ImportError):
             pass
 
     def __getitem__(self, n):