# Test failures in contrib/remote-helpers

6 messages from 2012-11-11 to 2012-11-13. Participants: Ramkumar Ramachandra, Felipe Contreras.
Thread: https://gitlist.dev/t/32066

## Ramkumar Ramachandra, 2012-11-11 10:32

Subject: Test failures in contrib/remote-helpers
Message-ID: <CALkWK0mU5O3Rqznkx-qn8VLFEgsMzOba1i8onSvf8X3FBeTs6g@mail.gmail.com>
URL: https://gitlist.dev/e/CALkWK0mU5O3Rqznkx-qn8VLFEgsMzOba1i8onSvf8X3FBeTs6g%40mail.gmail.com

```
Hi,

I'm experiencing test failures in contrib/remote-helpers.

>From the first test in test-bzr.sh:

Traceback (most recent call last):
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-bzr",
line 672, in <module>
    sys.exit(main(sys.argv))
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-bzr",
line 651, in main
    repo = get_repo(url, alias)
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-bzr",
line 608, in get_repo
    origin = bzrlib.controldir.ControlDir.open(url)
AttributeError: type object 'ControlDir' has no attribute 'open'

>From the first test in test-hg.sh:

Traceback (most recent call last):
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 785, in <module>
    sys.exit(main(sys.argv))
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 773, in main
    do_import(parser)
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 500, in do_import
    export_head(repo)
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 397, in export_head
    export_ref(repo, g_head[0], 'bookmarks', g_head[1])
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 297, in export_ref
    revs = repo.revs('%u:%u' % (tip, head))
AttributeError: 'localrepository' object has no attribute 'revs'
fatal: stream ends early
fast-import: dumping crash report to
/home/likewise-open/ANT/ramkum/src/git/t/trash
directory.test-hg/gitrepo/.git/fast_import_crash_24346
fatal: Error while running fast-import

>From the first test in test-hg-bidi.sh:

Traceback (most recent call last):
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 785, in <module>
    sys.exit(main(sys.argv))
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 773, in main
    do_import(parser)
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 500, in do_import
    export_head(repo)
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 397, in export_head
    export_ref(repo, g_head[0], 'bookmarks', g_head[1])
  File "/home/likewise-open/ANT/ramkum/src/git/contrib/remote-helpers/git-remote-hg",
line 297, in export_ref
    revs = repo.revs('%u:%u' % (tip, head))
AttributeError: 'localrepository' object has no attribute 'revs'
fatal: stream ends early
fast-import: dumping crash report to
/home/likewise-open/ANT/ramkum/src/git/t/trash
directory.test-hg-bidi/tmp/gitrepo2/.git/fast_import_crash_25121
fatal: Error while running fast-import

I can't `import hggit` (I don't know how hg-git is distributed), so I
didn't run test-hg-hg-git.sh.

I'm currently investigating.

Ram

```

## Felipe Contreras, 2012-11-11 12:00

Subject: Re: Test failures in contrib/remote-helpers
Message-ID: <CAMP44s1TLyKoHVouwgCFqi-vwA6rUBYJZXTA7JDFX6bfyQ7_tw@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s1TLyKoHVouwgCFqi-vwA6rUBYJZXTA7JDFX6bfyQ7_tw%40mail.gmail.com
In-Reply-To: <CALkWK0mU5O3Rqznkx-qn8VLFEgsMzOba1i8onSvf8X3FBeTs6g@mail.gmail.com>

```
Hi,

On Sun, Nov 11, 2012 at 11:32 AM, Ramkumar Ramachandra
<artagnon@gmail.com> wrote:
> I'm experiencing test failures in contrib/remote-helpers.

Which are your versions of hg, and bzr?

-- 
Felipe Contreras

```

## Ramkumar Ramachandra, 2012-11-11 12:48

Subject: Re: Test failures in contrib/remote-helpers
Message-ID: <CALkWK0k9trxx8NC1GWw-yYzBKhFchrvg2JLeBtyoAkokmv9A0w@mail.gmail.com>
URL: https://gitlist.dev/e/CALkWK0k9trxx8NC1GWw-yYzBKhFchrvg2JLeBtyoAkokmv9A0w%40mail.gmail.com
In-Reply-To: <CAMP44s1TLyKoHVouwgCFqi-vwA6rUBYJZXTA7JDFX6bfyQ7_tw@mail.gmail.com>

```
Felipe Contreras wrote:
> On Sun, Nov 11, 2012 at 11:32 AM, Ramkumar Ramachandra
> <artagnon@gmail.com> wrote:
>> I'm experiencing test failures in contrib/remote-helpers.
>
> Which are your versions of hg, and bzr?

Mercurial Distributed SCM (version 1.9.1)
Bazaar (bzr) 2.4.1

Ram

```

## Felipe Contreras, 2012-11-11 19:50

Subject: Re: Test failures in contrib/remote-helpers
Message-ID: <CAMP44s14J_D_pZuRL4zrc1iphxf7tnFuA4Vpx7d1JTDUts84uw@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s14J_D_pZuRL4zrc1iphxf7tnFuA4Vpx7d1JTDUts84uw%40mail.gmail.com
In-Reply-To: <CALkWK0k9trxx8NC1GWw-yYzBKhFchrvg2JLeBtyoAkokmv9A0w@mail.gmail.com>

```
On Sun, Nov 11, 2012 at 1:48 PM, Ramkumar Ramachandra
<artagnon@gmail.com> wrote:
> Felipe Contreras wrote:
>> On Sun, Nov 11, 2012 at 11:32 AM, Ramkumar Ramachandra
>> <artagnon@gmail.com> wrote:
>>> I'm experiencing test failures in contrib/remote-helpers.
>>
>> Which are your versions of hg, and bzr?
>
> Mercurial Distributed SCM (version 1.9.1)

I can reproduce the issue, this fixes it for versions up to 1.8:

--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -294,7 +294,7 @@ def export_ref(repo, name, kind, head):
     if tip and tip == head.rev():
         # nothing to do
         return
-    revs = repo.revs('%u:%u' % (tip, head))
+    revs = xrange(tip, head.rev() + 1)
     count = 0

     revs = [rev for rev in revs if not marks.is_marked(rev)]

I don't think it makes sense to aim anything lower.

-- 
Felipe Contreras

```

## Felipe Contreras, 2012-11-13 00:35

Subject: Re: Test failures in contrib/remote-helpers
Message-ID: <CAMP44s1E7qKCPTH1MMuOwJkW8opmD+Q6bzD6j1-KM039g-Uq2g@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s1E7qKCPTH1MMuOwJkW8opmD%2BQ6bzD6j1-KM039g-Uq2g%40mail.gmail.com
In-Reply-To: <CALkWK0k9trxx8NC1GWw-yYzBKhFchrvg2JLeBtyoAkokmv9A0w@mail.gmail.com>

```
On Sun, Nov 11, 2012 at 1:48 PM, Ramkumar Ramachandra
<artagnon@gmail.com> wrote:
> Felipe Contreras wrote:
>> On Sun, Nov 11, 2012 at 11:32 AM, Ramkumar Ramachandra
>> <artagnon@gmail.com> wrote:
>>> I'm experiencing test failures in contrib/remote-helpers.
>>
>> Which are your versions of hg, and bzr?
>
> Mercurial Distributed SCM (version 1.9.1)
> Bazaar (bzr) 2.4.1

And here's the one for bzr:

--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -646,12 +646,12 @@ def get_repo(url, alias):
     global dirname, peer

     clone_path = os.path.join(dirname, 'clone')
-    origin = bzrlib.controldir.ControlDir.open(url)
+    origin = bzrlib.bzrdir.BzrDir.open(url)
     remote_branch = origin.open_branch()

     if os.path.exists(clone_path):
         # pull
-        d = bzrlib.controldir.ControlDir.open(clone_path)
+        d = bzrlib.bzrdir.BzrDir.open(clone_path)
         branch = d.open_branch()
         result = branch.pull(remote_branch, [], None, False)
     else:

I have other fixes to run up to 2.0.

Cheers.

-- 
Felipe Contreras

```

## Ramkumar Ramachandra, 2012-11-13 05:29

Subject: Re: Test failures in contrib/remote-helpers
Message-ID: <CALkWK0=+HGzLpFNPn_mo2_zt+pqYs230ZK4x3SweiFcXCD5zHQ@mail.gmail.com>
URL: https://gitlist.dev/e/CALkWK0%3D%2BHGzLpFNPn_mo2_zt%2BpqYs230ZK4x3SweiFcXCD5zHQ%40mail.gmail.com
In-Reply-To: <CAMP44s1E7qKCPTH1MMuOwJkW8opmD+Q6bzD6j1-KM039g-Uq2g@mail.gmail.com>

```
Felipe Contreras wrote:
> And here's the one for bzr:
>
> --- a/contrib/remote-helpers/git-remote-bzr
> +++ b/contrib/remote-helpers/git-remote-bzr
> @@ -646,12 +646,12 @@ def get_repo(url, alias):
>      global dirname, peer
>
>      clone_path = os.path.join(dirname, 'clone')
> -    origin = bzrlib.controldir.ControlDir.open(url)
> +    origin = bzrlib.bzrdir.BzrDir.open(url)
>      remote_branch = origin.open_branch()
>
>      if os.path.exists(clone_path):
>          # pull
> -        d = bzrlib.controldir.ControlDir.open(clone_path)
> +        d = bzrlib.bzrdir.BzrDir.open(clone_path)
>          branch = d.open_branch()
>          result = branch.pull(remote_branch, [], None, False)
>      else:
>
> I have other fixes to run up to 2.0.

Works for me.  All four tests pass now.
Reported-by: Ramkumar Ramachandra <artagnon@gmail.com>
Tested-by: Ramkumar Ramachandra <artagnon@gmail.com>

Ram

```
