# HG changeset patch # User Sverre Rabbelier # Date 1241917431 25200 # Node ID b88d6b2149145000f7151ee48c90cab50b0a2947 # Parent 3127001779791b4654577b862e0e9d04c27aa32b strip redundant module path and dict accessing diff --git a/git_handler.py b/git_handler.py --- a/git_handler.py +++ b/git_handler.py @@ -58,7 +58,7 @@ git_hg_path = os.path.join(self.repo.path, 'git') if not os.path.exists(git_hg_path): os.mkdir(git_hg_path) - dulwich.repo.Repo.init_bare(git_hg_path) + Repo.init_bare(git_hg_path) def load_git(self): git_dir = os.path.join(self.repo.path, 'git') @@ -71,16 +71,10 @@ self._map_hg[hgsha] = gitsha def map_hg_get(self, gitsha): - if gitsha in self._map_git: - return self._map_git[gitsha] - else: - return None + return self._map_git.get(gitsha) def map_git_get(self, hgsha): - if hgsha in self._map_hg: - return self._map_hg[hgsha] - else: - return None + return self._map_hg.get(hgsha) def load_map(self): self._map_git = {}