# HG changeset patch # User Siddharth Agarwal # Date 1413325269 25200 # Node ID 4f425a1be4f304c97762790238c11bf4344fb0b6 # Parent c37842fffb16e37907912909a4a6630f3023a92b git_handler: rename convert_list to commit_cache convert_list is not the best naming choice for this variable. It is neither a list nor has anything to directly do with conversion -- it is simply a cache of commit hashes to the Git objects backing them. diff --git a/hggit/git_handler.py b/hggit/git_handler.py --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -664,7 +664,7 @@ # import heads and fetched tags as remote references todo = [] done = set() - convert_list = {} + commit_cache = {} # get a list of all the head shas seenheads = set() @@ -700,11 +700,11 @@ todo.pop() continue assert isinstance(sha, str) - if sha in convert_list: - obj = convert_list[sha] + if sha in commit_cache: + obj = commit_cache[sha] else: obj = self.git.get_object(sha) - convert_list[sha] = obj + commit_cache[sha] = obj assert isinstance(obj, Commit) for p in obj.parents: if p not in done and p not in self._map_git: @@ -717,10 +717,10 @@ done.add(sha) todo.pop() - return convert_list, commits + return commit_cache, commits def import_git_objects(self, remote_name=None, refs=None): - convert_list, commits = self.getnewgitcommits(refs) + commit_cache, commits = self.getnewgitcommits(refs) # import each of the commits, oldest first total = len(commits) if total: @@ -730,7 +730,7 @@ for i, csha in enumerate(commits): self.ui.progress('importing', i, total=total, unit='commits') - commit = convert_list[csha] + commit = commit_cache[csha] self.import_git_commit(commit) self.ui.progress('importing', None, total=total, unit='commits')