# HG changeset patch # User Sean Farley # Date 1429745104 25200 # Wed Apr 22 16:25:04 2015 -0700 # Node ID 5322f12e64edc84c5b44174c93113c6d41e83645 # Parent 1b001f9df71b12966dd13f6f0a0b9ca59b463fd0 gitrepo: flake8 cleanups diff --git a/hggit/gitrepo.py b/hggit/gitrepo.py --- a/hggit/gitrepo.py +++ b/hggit/gitrepo.py @@ -1,4 +1,3 @@ -import os from mercurial import util try: from mercurial.error import RepoError @@ -10,10 +9,6 @@ except ImportError: from mercurial.repo import repository as peerrepository -from overlay import overlayrepo - -from mercurial.node import bin - class gitrepo(peerrepository): capabilities = ['lookup'] @@ -21,7 +16,7 @@ return self.capabilities def __init__(self, ui, path, create): - if create: # pragma: no cover + if create: # pragma: no cover raise util.Abort('Cannot create a git repository.') self.ui = ui self.path = path @@ -43,7 +38,7 @@ def listkeys(self, namespace): if namespace == 'namespaces': - return {'bookmarks':''} + return {'bookmarks': ''} elif namespace == 'bookmarks': if self.localrepo is not None: handler = self.localrepo.githandler @@ -51,8 +46,8 @@ # map any git shas that exist in hg to hg shas stripped_refs = dict([ (ref[11:], handler.map_hg_get(refs[ref]) or refs[ref]) - for ref in refs.keys() - if ref.startswith('refs/heads/')]) + for ref in refs.keys() if ref.startswith('refs/heads/') + ]) return stripped_refs return {}