# HG changeset patch # User Siddharth Agarwal # Date 1413329737 25200 # Node ID 77416ddca136ca754042b71729a88abbad634677 # Parent e734d71cc558c95450dde1123f86fa88cfe30885 git2hg: return a struct from find_incoming We're going to return more data from find_incoming soon. Make that easier than parsing a tuple. diff -r e734d71cc558 -r 77416ddca136 hggit/git2hg.py --- a/hggit/git2hg.py Tue Oct 14 15:54:58 2014 -0700 +++ b/hggit/git2hg.py Tue Oct 14 16:35:37 2014 -0700 @@ -63,4 +63,10 @@ done.add(sha) todo.pop() - return commit_cache, commits + return GitIncomingResult(commits, commit_cache) + +class GitIncomingResult(object): + '''struct to store result from find_incoming''' + def __init__(self, commits, commit_cache): + self.commits = commits + self.commit_cache = commit_cache diff -r e734d71cc558 -r 77416ddca136 hggit/git_handler.py --- a/hggit/git_handler.py Tue Oct 14 15:54:58 2014 -0700 +++ b/hggit/git_handler.py Tue Oct 14 16:35:37 2014 -0700 @@ -369,7 +369,7 @@ else: reqrefs = refs - commits = [bin(c) for c in self.get_git_incoming(reqrefs)[1]] + commits = [bin(c) for c in self.get_git_incoming(reqrefs).commits] b = overlayrepo(self, commits, refs) @@ -667,7 +667,9 @@ return git2hg.find_incoming(self.git.object_store, self._map_git, refs) def import_git_objects(self, remote_name=None, refs=None): - commit_cache, commits = self.get_git_incoming(refs) + result = self.get_git_incoming(refs) + commits = result.commits + commit_cache = result.commit_cache # import each of the commits, oldest first total = len(commits) if total: