Skip to content
Snippets Groups Projects
Commit c99941ff authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

overlayrevlog: handle root commits correctly

Previously, we'd try to access commit.parents[0] and fail. Now, check for
commit.parents being empty and return what Mercurial thinks is a repository
root in that case.
parent aa8519da
No related branches found
No related tags found
No related merge requests found
......@@ -192,6 +192,9 @@
return self.base.parents(n)
commit = self.repo.handler.git.get_object(_maybehex(n))
if not commit.parents:
return [nullid, nullid]
def gitorhg(n):
hn = self.repo.handler.map_hg_get(hex(n))
if hn is not None:
......
......@@ -9,6 +9,15 @@
$ fn_git_commit -m "add alpha"
$ cd ..
$ hg init hgrepo-empty
$ hg -R hgrepo-empty incoming gitrepo | grep -v 'no changes found' | grep -v 'bookmark:'
comparing with gitrepo
changeset: 0:7eeab2ea75ec
user: test <test@example.org>
date: Mon Jan 01 00:00:10 2007 +0000
summary: add alpha
$ hg clone gitrepo hgrepo | grep -v '^updating'
importing git objects into hg
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment