Mercurial > hg-git
diff hggit/git_handler.py @ 784:4f425a1be4f3
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.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 14 Oct 2014 15:21:09 -0700 |
parents | c37842fffb16 |
children | 2f6507057987 |
line wrap: on
line diff
--- a/hggit/git_handler.py Tue Oct 14 14:52:38 2014 -0700 +++ b/hggit/git_handler.py Tue Oct 14 15:21:09 2014 -0700 @@ -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')