diff --git a/hggit/overlay.py b/hggit/overlay.py index 1189a4f3e2389ed831acd1e364a118253cf9fbaa_aGdnaXQvb3ZlcmxheS5weQ==..668859fc46b751aac453b9a06e1d7abcd48c470a_aGdnaXQvb3ZlcmxheS5weQ== 100644 --- a/hggit/overlay.py +++ b/hggit/overlay.py @@ -42,6 +42,6 @@ self._flagmap = {} def addtree(tree, dirname): - for entry in tree.entries(): - if entry[0] & 040000: + for entry in tree.iteritems(): + if entry.mode & 040000: # expand directory @@ -47,4 +47,4 @@ # expand directory - subtree = self.repo.handler.git.get_object(entry[2]) - addtree(subtree, dirname + entry[1] + '/') + subtree = self.repo.handler.git.get_object(entry.sha) + addtree(subtree, dirname + entry.path + '/') else: @@ -50,7 +50,7 @@ else: - path = dirname + entry[1] - self._map[path] = bin(entry[2]) - self._flagmap[path] = entry[0] + path = dirname + entry.path + self._map[path] = bin(entry.sha) + self._flagmap[path] = entry.mode addtree(self.tree, '') diff --git a/tests/test-incoming b/tests/test-incoming index 1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1pbmNvbWluZw==..668859fc46b751aac453b9a06e1d7abcd48c470a_dGVzdHMvdGVzdC1pbmNvbWluZw== 100755 --- a/tests/test-incoming +++ b/tests/test-incoming @@ -59,7 +59,7 @@ hg clone git://localhost/gitrepo hgrepo | grep -v '^updating' cd hgrepo -hg incoming +hg incoming | grep -v 'no changes found' | grep -v 'bookmark:' cd ../gitrepo echo beta > beta @@ -67,7 +67,7 @@ commit -m 'add beta' cd ../hgrepo -hg incoming +hg incoming | grep -v 'no changes found' | grep -v 'bookmark:' cd ../gitrepo git checkout -b b1 HEAD^ @@ -82,6 +82,6 @@ commit -m'add d/gamma line 2' cd ../hgrepo -hg incoming -p +hg incoming -p | grep -v 'no changes found' | grep -v 'bookmark:' echo % incoming -r @@ -86,8 +86,8 @@ echo % incoming -r -hg incoming -r master -hg incoming -r b1 -hg incoming -r t1 +hg incoming -r master | grep -v 'no changes found' | grep -v 'bookmark:' +hg incoming -r b1 | grep -v 'no changes found' | grep -v 'bookmark:' +hg incoming -r t1 | grep -v 'no changes found' | grep -v 'bookmark:' echo % nothing incoming after pull hg pull @@ -91,6 +91,6 @@ echo % nothing incoming after pull hg pull -hg incoming +hg incoming | grep -v 'no changes found' | grep -v 'bookmark:' echo 'done' diff --git a/tests/test-incoming.out b/tests/test-incoming.out index 1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1pbmNvbWluZy5vdXQ=..668859fc46b751aac453b9a06e1d7abcd48c470a_dGVzdHMvdGVzdC1pbmNvbWluZy5vdXQ= 100644 --- a/tests/test-incoming.out +++ b/tests/test-incoming.out @@ -5,9 +5,8 @@ importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved comparing with git://localhost/gitrepo -no changes found comparing with git://localhost/gitrepo Counting objects: 3, done. Compressing objects: 50% (1/2) Compressing objects: 100% (2/2) Compressing objects: 100% (2/2), done. Total 3 (delta 0), reused 0 (delta 0) changeset: 1:9497a4ee62e1 @@ -9,9 +8,8 @@ comparing with git://localhost/gitrepo Counting objects: 3, done. Compressing objects: 50% (1/2) Compressing objects: 100% (2/2) Compressing objects: 100% (2/2), done. Total 3 (delta 0), reused 0 (delta 0) changeset: 1:9497a4ee62e1 -bookmark: master user: test <test@example.org> date: Mon Jan 01 00:00:11 2007 +0000 summary: add beta @@ -22,7 +20,6 @@ Compressing objects: 25% (1/4) Compressing objects: 50% (2/4) Compressing objects: 75% (3/4) Compressing objects: 100% (4/4) Compressing objects: 100% (4/4), done. Total 8 (delta 0), reused 0 (delta 0) changeset: 1:9497a4ee62e1 -bookmark: master user: test <test@example.org> date: Mon Jan 01 00:00:11 2007 +0000 summary: add beta @@ -47,7 +44,6 @@ +gamma changeset: 3:5202f48c20c9 -bookmark: b1 user: test <test@example.org> date: Mon Jan 01 00:00:13 2007 +0000 summary: add d/gamma line 2 @@ -62,7 +58,6 @@ % incoming -r comparing with git://localhost/gitrepo changeset: 1:9497a4ee62e1 -bookmark: master user: test <test@example.org> date: Mon Jan 01 00:00:11 2007 +0000 summary: add beta @@ -75,7 +70,6 @@ summary: add d/gamma changeset: 2:5202f48c20c9 -bookmark: b1 user: test <test@example.org> date: Mon Jan 01 00:00:13 2007 +0000 summary: add d/gamma line 2 @@ -92,5 +86,4 @@ importing git objects into hg (run 'hg heads' to see heads, 'hg merge' to merge) comparing with git://localhost/gitrepo -no changes found done diff --git a/tests/test-outgoing b/tests/test-outgoing index 1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1vdXRnb2luZw==..668859fc46b751aac453b9a06e1d7abcd48c470a_dGVzdHMvdGVzdC1vdXRnb2luZw== 100755 --- a/tests/test-outgoing +++ b/tests/test-outgoing @@ -67,9 +67,9 @@ hg book -r 1 beta -hg outgoing -hg outgoing -r beta -hg outgoing -r master +hg outgoing | sed 's/bookmark: /tag: /' | grep -v 'searching for changes' +hg outgoing -r beta | sed 's/bookmark: /tag: /' | grep -v 'searching for changes' +hg outgoing -r master | sed 's/bookmark: /tag: /' | grep -v 'searching for changes' cd .. @@ -88,9 +88,9 @@ hg outgoing echo % let\'s pull and try again hg pull -hg outgoing -hg outgoing -r beta -hg outgoing -r master +hg outgoing | sed 's/bookmark: /tag: /' | grep -v 'searching for changes' +hg outgoing -r beta | sed 's/bookmark: /tag: /' | grep -v 'searching for changes' +hg outgoing -r master | sed 's/bookmark: /tag: /' | grep -v 'searching for changes' cd ..