comparison rhodecode/lib/diffs.py @ 2684:2b6939a77052 beta

Bumped mercurial version to 2.3 - fixed issues with compare of two remote repos at particular revisions - added tests for cases when mercurial update broke code and tests didn't catch this - removed obsolete EmptyChangeset from the rhodecode code
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 04 Aug 2012 01:20:38 +0200
parents 5fe0f744bec0
children 69420c48a0e6
comparison
equal deleted inserted replaced
2683:eaf1782bee64 2684:2b6939a77052
32 from itertools import tee, imap 32 from itertools import tee, imap
33 33
34 from mercurial import patch 34 from mercurial import patch
35 from mercurial.mdiff import diffopts 35 from mercurial.mdiff import diffopts
36 from mercurial.bundlerepo import bundlerepository 36 from mercurial.bundlerepo import bundlerepository
37 from mercurial import localrepo
38 37
39 from pylons.i18n.translation import _ 38 from pylons.i18n.translation import _
40 39
41 from rhodecode.lib.compat import BytesIO 40 from rhodecode.lib.compat import BytesIO
41 from rhodecode.lib.vcs.utils.hgcompat import localrepo
42 from rhodecode.lib.vcs.exceptions import VCSError 42 from rhodecode.lib.vcs.exceptions import VCSError
43 from rhodecode.lib.vcs.nodes import FileNode, SubModuleNode 43 from rhodecode.lib.vcs.nodes import FileNode, SubModuleNode
44 from rhodecode.lib.vcs.backends.base import EmptyChangeset
44 from rhodecode.lib.helpers import escape 45 from rhodecode.lib.helpers import escape
45 from rhodecode.lib.utils import EmptyChangeset, make_ui 46 from rhodecode.lib.utils import make_ui
46 47
47 48
48 def wrap_to_table(str_): 49 def wrap_to_table(str_):
49 return '''<table class="code-difftable"> 50 return '''<table class="code-difftable">
50 <tr class="line no-comment"> 51 <tr class="line no-comment">
597 other_ref = other_ref[1] 598 other_ref = other_ref[1]
598 599
599 if org_repo != other_repo: 600 if org_repo != other_repo:
600 601
601 common, incoming, rheads = discovery_data 602 common, incoming, rheads = discovery_data
602 603 other_repo_peer = localrepo.locallegacypeer(other_repo.local())
603 # create a bundle (uncompressed if other repo is not local) 604 # create a bundle (uncompressed if other repo is not local)
604 if other_repo.capable('getbundle') and incoming: 605 if other_repo_peer.capable('getbundle') and incoming:
605 # disable repo hooks here since it's just bundle ! 606 # disable repo hooks here since it's just bundle !
606 # patch and reset hooks section of UI config to not run any 607 # patch and reset hooks section of UI config to not run any
607 # hooks on fetching archives with subrepos 608 # hooks on fetching archives with subrepos
608 for k, _ in other_repo.ui.configitems('hooks'): 609 for k, _ in other_repo.ui.configitems('hooks'):
609 other_repo.ui.setconfig('hooks', k, None) 610 other_repo.ui.setconfig('hooks', k, None)