glandium / git-cinnabar

git remote helper to interact with mercurial repositories

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERROR getbundle() got an unexpected keyword argument 'bundlecaps'

dmose opened this issue · comments

Trying to build a langpack, I see:

 0:05.45 /usr/bin/make -s -j4 -s langpack-de
 0:05.66 Making langpack
 0:05.70 Checking out /Users/dmose/.mozbuild/l10n-central/de
 0:05.81 Klone nach 'de' ...
 0:06.78 warning: hg.mozilla.org certificate with fingerprint 01:b4:17:f7:f8:a9:e6:13:39:68:b3:0a:76:76:48:8d:e0:41:b3:b9 not verified (check hostfingerprints or web.cacerts config setting)
 0:06.95 fatal: Unsupported command: error
 0:06.96 fast-import: dumping crash report to /Users/dmose/.mozbuild/l10n-central/de/.git/fast_import_crash_50183
 0:06.96 ERROR getbundle() got an unexpected keyword argument 'bundlecaps'
 0:06.96 Run the command again with `git -c cinnabar.check=traceback <command>` to see the full traceback.
 0:06.96 fatal: Fehler beim Ausführen von 'fast-import'.

Excitingly, despite what fast-import says about dumping the crash-report, the ~/.mozbuild/l10n-central directory is completely empty, quite possibly because I've never done anything to cause l10n-central to be cloned before. (In fact, the reason I did this, was to try to force a clone of l10n-central).

Can you run git -c cinnabar.check=traceback -C /Users/dmose/.mozbuild/l10n-central clone hg://hg.mozilla.org/l10n-central/de/ and paste its output?

% git -c cinnabar.check=traceback -C /Users/dmose/.mozbuild/l10n-central clone hg://hg.mozilla.org/l10n-central/de/
Found existing alias for "git". You should use: "g"
Klone nach 'de' ...
warning: hg.mozilla.org certificate with fingerprint 01:b4:17:f7:f8:a9:e6:13:39:68:b3:0a:76:76:48:8d:e0:41:b3:b9 not verified (check hostfingerprints or web.cacerts config setting)
Traceback (most recent call last):
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/util.py", line 1002, in run
    retcode = func(args)
  File "/Users/dmose/.mozbuild/git-cinnabar/git-remote-hg", line 57, in main
    helper.run()
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/remote_helper.py", line 86, in run
    self.import_(*args)
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/remote_helper.py", line 421, in import_
    self._branchmap.names())
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/hg/repo.py", line 1037, in getbundle
    **kwargs)
TypeError: getbundle() got an unexpected keyword argument 'bundlecaps'
fatal: Unsupported command: error
fast-import: dumping crash report to /Users/dmose/.mozbuild/l10n-central/de/.git/fast_import_crash_60334
fatal: Fehler beim Ausf"uhren von 'fast-import'.

File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/hg/repo.py", line 1037, in getbundle
**kwargs)

I couldn't find a version of git-cinnabar that had that code at that line number of that file. What version is this?

% git cinnabar --version                        
0.5.8a
module-hash: f4fa777d377dc931c3cb171493aa10c34113f0b2
helper-hash: a8ea68e3100b5b6a267ae9b04ec1e83d57043df3

I don't know what I was doing yesterday, but tip of master does have that code at that line...

Can you apply the following, try the same command again, and report what it says?

diff --git a/cinnabar/hg/repo.py b/cinnabar/hg/repo.py
index 41377d5..4205739 100644
--- a/cinnabar/hg/repo.py
+++ b/cinnabar/hg/repo.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, division, unicode_literals
+from __future__ import absolute_import, division, unicode_literals, print_function
 import os
 import re
 import ssl
@@ -1032,9 +1032,17 @@ def getbundle(repo, store, heads, branch_names):
                 b'bundle2=%s' % quote_from_bytes(
                     encodecaps(bundle2caps)).encode('ascii')))
 
-        bundle = repo.getbundle(b'bundle', heads=[unhexlify(h) for h in heads],
-                                common=[unhexlify(h) for h in common],
-                                **kwargs)
+        try:
+            bundle = repo.getbundle(b'bundle', heads=[unhexlify(h) for h in heads],
+                                    common=[unhexlify(h) for h in common],
+                                    **kwargs)
+        except Exception:
+            from mercurial.util import version
+            print('{} {}'.format(
+                type(repo),
+                sys.modules[type(repo).__module__].__file__,
+                version(),
+                file=sys.stderr)
 
         bundle = unbundler(bundle)
 

Here you go:

% git -c cinnabar.check=traceback -C /Users/dmose/.mozbuild/l10n-central clone hg://hg.mozilla.org/l10n-central/de/ 
Found existing alias for "git". You should use: "g"
Klone nach 'de' ...
warning: hg.mozilla.org certificate with fingerprint 01:b4:17:f7:f8:a9:e6:13:39:68:b3:0a:76:76:48:8d:e0:41:b3:b9 not verified (check hostfingerprints or web.cacerts config setting)
Traceback (most recent call last):
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/util.py", line 1002, in run
    retcode = func(args)
  File "/Users/dmose/.mozbuild/git-cinnabar/git-remote-hg", line 57, in main
    helper.run()
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/remote_helper.py", line 86, in run
    self.import_(*args)
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/remote_helper.py", line 421, in import_
    self._branchmap.names())
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/hg/repo.py", line 1037, in getbundle
    **kwargs)
TypeError: getbundle() got an unexpected keyword argument 'bundlecaps'

The `master` branch of git-cinnabar was updated. Please update your copy.
You can switch to the `release` branch if you want to reduce these update notifications.
fatal: Unsupported command: error

The exception is still on the same line, although the patch ought to have moved it (also, I forgot to add a raise at the end of the exception handling, so it should not throw that exception at all with the patch applied)

Excitingly, this error has re-appeared on my regular mozilla-unified repo, which is blocking it from doing anything. I tweaked the patch a bit, so it now looks like this:

diff --git a/cinnabar/hg/repo.py b/cinnabar/hg/repo.py
index ba52356..c8ac075 100644
--- a/cinnabar/hg/repo.py
+++ b/cinnabar/hg/repo.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import, division, unicode_literals
+from __future__ import absolute_import, division, unicode_literals, print_function
 import os
 import re
 import ssl
@@ -1032,9 +1032,18 @@ def getbundle(repo, store, heads, branch_names):
                 b'bundle2=%s' % quote_from_bytes(
                     encodecaps(bundle2caps)).encode('ascii')))
 
-        bundle = repo.getbundle(b'bundle', heads=[unhexlify(h) for h in heads],
-                                common=[unhexlify(h) for h in common],
-                                **kwargs)
+        try:
+            bundle = repo.getbundle(b'bundle', heads=[unhexlify(h) for h in heads],
+                                    common=[unhexlify(h) for h in common],
+                                    **kwargs)
+        except Exception:
+            from mercurial.util import version
+            print('{} {} {}'.format(
+                type(repo),
+                sys.modules[type(repo).__module__].__file__,
+                version()),
+                file=sys.stderr)
+            raise Exception("here we are")
 
         bundle = unbundler(bundle)

and with that patch applied, running git -c cinnabar.check=traceback remote update mozilla results in:

dmose3@MacBook-Pro git-cin-mc % git -c cinnabar.check=traceback remote update mozilla
Found existing alias for "git". You should use: "g"
Fordere an von mozilla
WARNING [config] cinnabar.experiments: python3 is not one of (wire, merge, store)
warning: hg.mozilla.org certificate with fingerprint b2:10:c0:33:79:47:86:86:c0:f9:91:41:b4:49:a5:3a:5d:ee:25:b0 not verified (check hostfingerprints or web.cacerts config setting)
<class 'mercurial.httppeer.httpspeer'> /Library/Python/2.7/site-packages/mercurial/httppeer.pyc 2.4.2+20130102
Traceback (most recent call last):
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/util.py", line 1002, in run
    retcode = func(args)
  File "/Users/dmose/.mozbuild/git-cinnabar/git-remote-hg", line 53, in main
    helper.run()
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/remote_helper.py", line 87, in run
    self.import_(*args)
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/remote_helper.py", line 423, in import_
    self._branchmap.names())
  File "/Users/dmose/.mozbuild/git-cinnabar/cinnabar/hg/repo.py", line 1046, in getbundle
    raise Exception("here we are")
Exception: here we are
fatal: Unsupported command: error
fast-import: dumping crash report to .git/fast_import_crash_68184
fatal: Fehler beim Ausführen von 'fast-import'.
error: Konnte nicht von mozilla anfordern

What do you think?

(The tweaks were to add a missing parens and add the raise that you mentioned in your last comment).

f1e64ef should avoid this problem with your original setup.

Thanks!