schacon / hg-git

mercurial to git bridge, pushed to directly from the hg-git plugin in Hg
GNU General Public License v2.0
620 stars 71 forks source link

push fails on upcoming Mercurial 1.6 #116

Closed yuja closed 13 years ago

yuja commented 13 years ago

Mercurial 1.6 will add 'newbranch' option to repo.push(), but hg-git's wrapper doesn't have it. This causes the following error on push:

TypeError: push() takes at most 4 arguments (5 given)

My workaround patch is available at: http://bitbucket.org/yuja/hg-git-mq/src/tip/newbranch.diff

durin42 commented 13 years ago

I've done an independent fix for this and will push it shortly.

yuja commented 13 years ago

Thanks. Is there another change planned to bring back --new-branch option? 0b20faee46f00c19a1b632806c29772aa83b90eb strips it for any repo backends.

durin42 commented 13 years ago

Huh? I'm not sure what you're talking about. Can you explain more? (I'm not sure what 0b20faee46f00c19a1b6 is - Google hasn't yet indexed that hash anywhere...)

yuja commented 13 years ago

I'm not sure what 0b20faee46f00c19a1b6 is

Oops, I've just edited it to be linked. The problem is if we enabled hggit extension globally, --new-branch doesn't take effect. It's not passed to hgrepo object.

-        def push(self, remote, force=False, revs=None):
+        # TODO figure out something useful to do with the newbranch param
+        def push(self, remote, force=False, revs=None, newbranch=None):
             if isinstance(remote, gitrepo):
                 git = GitHandler(self, self.ui)
                 git.push(remote.path, revs, force)
             else: #pragma: no cover
                 return super(hgrepo, self).push(remote, force, revs)
durin42 commented 13 years ago

Oh, oops. I'll push a fix for that ASAP.

yuja commented 13 years ago

--new-branch works now. Thank you.