diff --git a/hggit/git_handler.py b/hggit/git_handler.py index 4cddcb768cf4b13050f796a1977fb6cf63f6bd27_aGdnaXQvZ2l0X2hhbmRsZXIucHk=..373f854ff58f1ea55294f19eebcbe627070bb368_aGdnaXQvZ2l0X2hhbmRsZXIucHk= 100644 --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -206,7 +206,8 @@ oldheads = self.repo.changelog.heads() imported = 0 if refs: - imported = self.import_git_objects(remote_name, refs) + filteredrefs = self.filter_refs(refs, heads) + imported = self.import_git_objects(remote_name, filteredrefs) self.import_tags(refs) self.update_hg_bookmarks(refs) if remote_name: diff --git a/tests/test-pull.t b/tests/test-pull.t index 4cddcb768cf4b13050f796a1977fb6cf63f6bd27_dGVzdHMvdGVzdC1wdWxsLnQ=..373f854ff58f1ea55294f19eebcbe627070bb368_dGVzdHMvdGVzdC1wdWxsLnQ= 100644 --- a/tests/test-pull.t +++ b/tests/test-pull.t @@ -12,6 +12,10 @@ $ echo beta > beta $ git add beta $ fn_git_commit -m 'add beta' + $ git checkout -qb delta master + $ echo delta > delta + $ git add delta + $ fn_git_commit -m 'add delta' $ cd .. clone a tag (ideally we'd want to pull it, but that seems broken for now) @@ -57,6 +61,7 @@ add another commit and tag to the git repo $ cd gitrepo + $ git checkout -q beta $ git tag t_beta $ git checkout -q master $ echo gamma > gamma @@ -70,9 +75,9 @@ importing git objects into hg (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R hgrepo log --graph - o changeset: 2:37c124f2d0a0 + o changeset: 3:56cabe48c4b0 | bookmark: master | tag: default/master | tag: tip | parent: 0:3442585be8a6 | user: test <test@example.org> @@ -74,8 +79,8 @@ | bookmark: master | tag: default/master | tag: tip | parent: 0:3442585be8a6 | user: test <test@example.org> - | date: Mon Jan 01 00:00:12 2007 +0000 + | date: Mon Jan 01 00:00:13 2007 +0000 | summary: add gamma | @@ -80,5 +85,13 @@ | summary: add gamma | + | o changeset: 2:4d41070bf840 + |/ bookmark: delta + | tag: default/delta + | parent: 0:3442585be8a6 + | user: test <test@example.org> + | date: Mon Jan 01 00:00:12 2007 +0000 + | summary: add delta + | | o changeset: 1:7bcd915dc873 |/ bookmark: beta | tag: default/beta @@ -108,7 +121,7 @@ importing git objects into hg (run 'hg update' to get a working copy) $ hg -R hgrepo log --graph - o changeset: 3:b8668fddf56c + o changeset: 4:892d20308ddf |\ bookmark: master | | tag: default/master | | tag: tip @@ -112,6 +125,6 @@ |\ bookmark: master | | tag: default/master | | tag: tip - | | parent: 2:37c124f2d0a0 + | | parent: 3:56cabe48c4b0 | | parent: 1:7bcd915dc873 | | user: test <test@example.org> @@ -116,5 +129,5 @@ | | parent: 1:7bcd915dc873 | | user: test <test@example.org> - | | date: Mon Jan 01 00:00:12 2007 +0000 + | | date: Mon Jan 01 00:00:13 2007 +0000 | | summary: Merge branch 'beta' | | @@ -119,5 +132,5 @@ | | summary: Merge branch 'beta' | | - | o changeset: 2:37c124f2d0a0 + | o changeset: 3:56cabe48c4b0 | | parent: 0:3442585be8a6 | | user: test <test@example.org> @@ -122,5 +135,5 @@ | | parent: 0:3442585be8a6 | | user: test <test@example.org> - | | date: Mon Jan 01 00:00:12 2007 +0000 + | | date: Mon Jan 01 00:00:13 2007 +0000 | | summary: add gamma | | @@ -125,5 +138,13 @@ | | summary: add gamma | | + | | o changeset: 2:4d41070bf840 + | |/ bookmark: delta + | | tag: default/delta + | | parent: 0:3442585be8a6 + | | user: test <test@example.org> + | | date: Mon Jan 01 00:00:12 2007 +0000 + | | summary: add delta + | | o | changeset: 1:7bcd915dc873 |/ bookmark: beta | tag: default/beta