Merge "Consolidate BadName exception compatibility"
This commit is contained in:
@@ -20,14 +20,10 @@ import re
|
|||||||
from git import BadObject
|
from git import BadObject
|
||||||
|
|
||||||
from git_upstream.errors import GitUpstreamError
|
from git_upstream.errors import GitUpstreamError
|
||||||
|
from git_upstream.lib.pygitcompat import BadName
|
||||||
from git_upstream.lib.utils import GitMixin
|
from git_upstream.lib.utils import GitMixin
|
||||||
from git_upstream.log import LogDedentMixin
|
from git_upstream.log import LogDedentMixin
|
||||||
|
|
||||||
try:
|
|
||||||
from git import BadName
|
|
||||||
except ImportError:
|
|
||||||
BadName = None
|
|
||||||
|
|
||||||
|
|
||||||
class DropError(GitUpstreamError):
|
class DropError(GitUpstreamError):
|
||||||
"""Exception thrown by L{Drop}"""
|
"""Exception thrown by L{Drop}"""
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ except ImportError:
|
|||||||
from git import Commit
|
from git import Commit
|
||||||
from git import Repo
|
from git import Repo
|
||||||
|
|
||||||
|
try:
|
||||||
|
from git import BadName
|
||||||
|
except ImportError:
|
||||||
|
BadName = object
|
||||||
|
|
||||||
|
|
||||||
class GitUpstreamCompatRepo(Repo):
|
class GitUpstreamCompatRepo(Repo):
|
||||||
|
|
||||||
|
|||||||
@@ -22,17 +22,12 @@ from git import Head
|
|||||||
|
|
||||||
from git_upstream.errors import GitUpstreamError
|
from git_upstream.errors import GitUpstreamError
|
||||||
from git_upstream.lib import note # noqa
|
from git_upstream.lib import note # noqa
|
||||||
|
from git_upstream.lib.pygitcompat import BadName
|
||||||
from git_upstream.lib.searchers import CommitMessageSearcher
|
from git_upstream.lib.searchers import CommitMessageSearcher
|
||||||
from git_upstream.lib.utils import GitMixin
|
from git_upstream.lib.utils import GitMixin
|
||||||
from git_upstream.log import LogDedentMixin
|
from git_upstream.log import LogDedentMixin
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
from git import BadName
|
|
||||||
except ImportError:
|
|
||||||
BadName = None
|
|
||||||
|
|
||||||
|
|
||||||
class SupersedeError(GitUpstreamError):
|
class SupersedeError(GitUpstreamError):
|
||||||
"""Exception thrown by L{Supersede}"""
|
"""Exception thrown by L{Supersede}"""
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user