comparison hggit/git_handler.py @ 704:373f854ff58f

git_handler.fetch: only import commits reachable from requested heads Previously we'd attempt to import every single reachable commit in the Git object store. The test adds another branch to the Git repo and doesn't import it until much later. Previously we'd import it when we ran `hg -R hgrepo pull -r beta`. Now we won't.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 04 Mar 2014 16:23:11 -0800
parents 4cddcb768cf4
children 4f0a154ae374
comparison
equal deleted inserted replaced
703:4cddcb768cf4 704:373f854ff58f
204 204
205 oldrefs = self.git.get_refs() 205 oldrefs = self.git.get_refs()
206 oldheads = self.repo.changelog.heads() 206 oldheads = self.repo.changelog.heads()
207 imported = 0 207 imported = 0
208 if refs: 208 if refs:
209 imported = self.import_git_objects(remote_name, refs) 209 filteredrefs = self.filter_refs(refs, heads)
210 imported = self.import_git_objects(remote_name, filteredrefs)
210 self.import_tags(refs) 211 self.import_tags(refs)
211 self.update_hg_bookmarks(refs) 212 self.update_hg_bookmarks(refs)
212 if remote_name: 213 if remote_name:
213 self.update_remote_branches(remote_name, refs) 214 self.update_remote_branches(remote_name, refs)
214 elif not self.paths: 215 elif not self.paths: