Beispiel #1
0
 def findoutgoing(self, remote, base=None, heads=None, force=False):
     if isinstance(remote, gitrepo):
         git = GitHandler(self, self.ui)
         base, heads = git.get_refs(remote.path)
         out, h = super(hgrepo, self).findoutgoing(remote, base, heads, force)
         return out
     else: #pragma: no cover
         return super(hgrepo, self).findoutgoing(remote, base, heads, force)
Beispiel #2
0
 def findoutgoing(self, remote, base=None, heads=None, force=False):
     if isinstance(remote, gitrepo):
         git = GitHandler(self, self.ui)
         base, heads = git.get_refs(remote.path)
         out, h = super(hgrepo, self).findoutgoing(remote, base, heads, force)
         return out
     else: #pragma: no cover
         return super(hgrepo, self).findoutgoing(remote, base, heads, force)
Beispiel #3
0
def findcommonoutgoing(orig, repo, other, *args, **kwargs):
    if isinstance(other, gitrepo.gitrepo):
        git = GitHandler(repo, repo.ui)
        heads = git.get_refs(other.path)[0]
        kw = {}
        kw.update(kwargs)
        for val, k in zip(args,
                ('onlyheads', 'force', 'commoninc', 'portable')):
            kw[k] = val
        force = kw.get('force', False)
        commoninc = kw.get('commoninc', None)
        if commoninc is None:
            commoninc = discovery.findcommonincoming(repo, other,
                heads=heads, force=force)
            kw['commoninc'] = commoninc
        return orig(repo, other, **kw)
    return orig(repo, other, *args, **kwargs)
Beispiel #4
0
 def findoutgoing(orig, local, remote, *args, **kwargs):
     kw = {}
     kw.update(kwargs)
     for val, k in zip(args, ('base', kwname, 'force')):
         kw[k] = val
     if isinstance(remote, gitrepo.gitrepo):
         # clean up this cruft when we're 1.7-only, remoteheads and
         # the return value change happened between 1.6 and 1.7.
         git = GitHandler(local, local.ui)
         base, heads = git.get_refs(remote.path)
         newkw = {'base': base, kwname: heads}
         newkw.update(kw)
         kw = newkw
         if kwname == 'heads':
             r = orig(local, remote, **kw)
             return [x[0] for x in r]
     return orig(local, remote, **kw)
Beispiel #5
0
def findcommonoutgoing(orig, repo, other, *args, **kwargs):
    if isinstance(other, gitrepo.gitrepo):
        git = GitHandler(repo, repo.ui)
        heads = git.get_refs(other.path)[0]
        kw = {}
        kw.update(kwargs)
        for val, k in zip(args,
                ('onlyheads', 'force', 'commoninc', 'portable')):
            kw[k] = val
        force = kw.get('force', False)
        commoninc = kw.get('commoninc', None)
        if commoninc is None:
            commoninc = discovery.findcommonincoming(repo, other,
                heads=heads, force=force)
            kw['commoninc'] = commoninc
        return orig(repo, other, **kw)
    return orig(repo, other, *args, **kwargs)
Beispiel #6
0
 def findoutgoing(orig, local, remote, *args, **kwargs):
     kw = {}
     kw.update(kwargs)
     for val, k in zip(args, ('base', kwname, 'force')):
         kw[k] = val
     if isinstance(remote, gitrepo.gitrepo):
         # clean up this cruft when we're 1.7-only, remoteheads and
         # the return value change happened between 1.6 and 1.7.
         git = GitHandler(local, local.ui)
         base, heads = git.get_refs(remote.path)
         newkw = {'base': base, kwname: heads}
         newkw.update(kw)
         kw = newkw
         if kwname == 'heads':
             r = orig(local, remote, **kw)
             return [x[0] for x in r]
     return orig(local, remote, **kw)
Beispiel #7
0
 def findoutgoing(orig, local, remote, *args, **kwargs):
     if isinstance(remote, gitrepo.gitrepo):
         hgver = hg.util.version()
         if hgver >= "1.8.9" or (hgver > "1.8" and "+" in hgver):
             raise hgutil.Abort("hg-git outgoing support is broken on hg 1.9.x")
         # clean up this cruft when we're 1.7-only, remoteheads and
         # the return value change happened between 1.6 and 1.7.
         kw = {}
         kw.update(kwargs)
         for val, k in zip(args, ("base", kwname, "force")):
             kw[k] = val
         git = GitHandler(local, local.ui)
         base, heads = git.get_refs(remote.path)
         newkw = {"base": base, kwname: heads}
         newkw.update(kw)
         kw = newkw
         if kwname == "heads":
             r = orig(local, remote, **kw)
             return [x[0] for x in r]
         if kwname == "onlyheads":
             del kw["base"]
         return orig(local, remote, **kw)
     return orig(local, remote, *args, **kwargs)
Beispiel #8
0
 def findoutgoing(orig, local, remote, *args, **kwargs):
     if isinstance(remote, gitrepo.gitrepo):
         hgver = hg.util.version()
         if hgver >= '1.8.9' or (hgver > '1.8' and '+' in hgver):
             raise hgutil.Abort(
                 'hg-git outgoing support is broken on hg 1.9.x')
         # clean up this cruft when we're 1.7-only, remoteheads and
         # the return value change happened between 1.6 and 1.7.
         kw = {}
         kw.update(kwargs)
         for val, k in zip(args, ('base', kwname, 'force')):
             kw[k] = val
         git = GitHandler(local, local.ui)
         base, heads = git.get_refs(remote.path)
         newkw = {'base': base, kwname: heads}
         newkw.update(kw)
         kw = newkw
         if kwname == 'heads':
             r = orig(local, remote, **kw)
             return [x[0] for x in r]
         if kwname == 'onlyheads':
             del kw['base']
         return orig(local, remote, **kw)
     return orig(local, remote, *args, **kwargs)
Beispiel #9
0
 def findoutgoing(orig, local, remote, *args, **kwargs):
     if isinstance(remote, gitrepo.gitrepo):
         hgver = hg.util.version()
         if hgver >= '1.8.9' or (hgver > '1.8' and '+' in hgver):
             raise hgutil.Abort(
                 'hg-git outgoing support is broken on hg 1.9.x')
         # clean up this cruft when we're 1.7-only, remoteheads and
         # the return value change happened between 1.6 and 1.7.
         kw = {}
         kw.update(kwargs)
         for val, k in zip(args, ('base', kwname, 'force')):
             kw[k] = val
         git = GitHandler(local, local.ui)
         base, heads = git.get_refs(remote.path)
         newkw = {'base': base, kwname: heads}
         newkw.update(kw)
         kw = newkw
         if kwname == 'heads':
             r = orig(local, remote, **kw)
             return [x[0] for x in r]
         if kwname == 'onlyheads':
             del kw['base']
         return orig(local, remote, **kw)
     return orig(local, remote, *args, **kwargs)