Mercurial > hg > hg-git
comparison hggit/__init__.py @ 900:11ca21820a95
overlay: adapt diff to work with lazymanifests
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 08 May 2015 16:00:45 -0700 |
parents | 8026c094173a |
children | 49831f78c412 |
comparison
equal
deleted
inserted
replaced
899:5cc2ad8a162b | 900:11ca21820a95 |
---|---|
34 from mercurial import extensions | 34 from mercurial import extensions |
35 from mercurial import help | 35 from mercurial import help |
36 from mercurial import hg | 36 from mercurial import hg |
37 from mercurial import ignore | 37 from mercurial import ignore |
38 from mercurial import localrepo | 38 from mercurial import localrepo |
39 from mercurial import manifest | |
39 from mercurial.node import hex | 40 from mercurial.node import hex |
40 from mercurial import revset | 41 from mercurial import revset |
41 from mercurial import scmutil | 42 from mercurial import scmutil |
42 from mercurial import templatekw | 43 from mercurial import templatekw |
43 from mercurial import util as hgutil | 44 from mercurial import util as hgutil |
44 from mercurial.i18n import _ | 45 from mercurial.i18n import _ |
45 | 46 |
46 import gitrepo | 47 import gitrepo |
47 import hgrepo | 48 import hgrepo |
49 import overlay | |
48 import util | 50 import util |
49 from git_handler import GitHandler | 51 from git_handler import GitHandler |
50 import verify | 52 import verify |
51 | 53 |
52 demandimport.ignore.extend([ | 54 demandimport.ignore.extend([ |
123 | 125 |
124 def reposetup(ui, repo): | 126 def reposetup(ui, repo): |
125 if not isinstance(repo, gitrepo.gitrepo): | 127 if not isinstance(repo, gitrepo.gitrepo): |
126 klass = hgrepo.generate_repo_subclass(repo.__class__) | 128 klass = hgrepo.generate_repo_subclass(repo.__class__) |
127 repo.__class__ = klass | 129 repo.__class__ = klass |
130 | |
131 if hgutil.safehasattr(manifest, '_lazymanifest'): | |
132 # Mercurial >= 3.4 | |
133 extensions.wrapfunction(manifest.manifestdict, 'diff', | |
134 overlay.wrapmanifestdictdiff) | |
128 | 135 |
129 @command('gimport') | 136 @command('gimport') |
130 def gimport(ui, repo, remote_name=None): | 137 def gimport(ui, repo, remote_name=None): |
131 '''import commits from Git to Mercurial''' | 138 '''import commits from Git to Mercurial''' |
132 repo.githandler.import_commits(remote_name) | 139 repo.githandler.import_commits(remote_name) |