~ubuntu-branches/ubuntu/raring/hg-git/raring

« back to all changes in this revision

Viewing changes to hggit/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Jakub Wilk
  • Date: 2010-07-07 13:51:05 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100707135105-vyqvwi8yvvsl41y3
Tags: 0.2.3-1
* New upstream release.
  + Fix compatiblity with Mercurial 1.6 (closes: #588325).
* Bump standards version to 3.9.0 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import os
19
19
 
20
 
from mercurial import commands, extensions, hg, util as hgutil
 
20
from mercurial import commands
 
21
from mercurial import extensions
 
22
from mercurial import hg
 
23
from mercurial import localrepo
 
24
from mercurial import util as hgutil
21
25
from mercurial.i18n import _
22
26
 
23
27
import gitrepo, hgrepo
92
96
    map(f.write, new_map)
93
97
    ui.status(_('git commit map cleaned\n'))
94
98
 
 
99
# drop this when we're 1.6-only, this just backports new behavior
 
100
def sortednodetags(orig, *args, **kwargs):
 
101
    ret = orig(*args, **kwargs)
 
102
    ret.sort()
 
103
    return ret
 
104
extensions.wrapfunction(localrepo.localrepository, 'nodetags', sortednodetags)
 
105
 
 
106
try:
 
107
    from mercurial import discovery
 
108
    def findoutgoing(orig, local, remote, base=None, heads=None, force=False):
 
109
        if isinstance(remote, gitrepo.gitrepo):
 
110
            git = GitHandler(local, local.ui)
 
111
            base, heads = git.get_refs(remote.path)
 
112
            r = orig(local, remote, base=base, heads=heads,
 
113
                        force=force)
 
114
            return [x[0] for x in r]
 
115
        return orig(local, remote, base=base, heads=heads, force=force)
 
116
    extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing)
 
117
except ImportError:
 
118
    pass
 
119
 
95
120
cmdtable = {
96
121
  "gimport":
97
122
        (gimport, [], _('hg gimport')),