comparison tests/test_util.py @ 1365:89997a5fc181 stable 1.8.4

stupid: self-disable if svn bindings are too new to work with stupid mode Subversion 1.9 enhanced the diff format slightly in a way that we can't parse. We're collectively weary in hgsubversion of parsing diffs to emulate replay given that ra_replay was new in Subversion 1.5, which is now 7.5 years old. Rather than try to adapt to the diff format changes, we'll disable stupid mode for 1.9 bindings and see if anyone actually bothers to email the list and tell us they saw the message. I figure if we don't see anything by mid 2016 or so we can rip out stupid mode entirely. Disable all tests that use stupid mode when 1.9 is in play. This should actually be a nice runtime win on the testsuite since we'll be running many hundreds fewer tests overall.
author Augie Fackler <raf@durin42.com>
date Thu, 31 Dec 2015 12:06:58 -0500
parents 3c213ca49f7e
children 019c3e194fba bac709b5ff6c
comparison
equal deleted inserted replaced
1364:460332aafe7d 1365:89997a5fc181
26 from mercurial import ui 26 from mercurial import ui
27 from mercurial import util as hgutil 27 from mercurial import util as hgutil
28 from mercurial import extensions 28 from mercurial import extensions
29 29
30 from hgsubversion import compathacks 30 from hgsubversion import compathacks
31 from hgsubversion import svnwrap
31 32
32 try: 33 try:
33 from mercurial import obsolete 34 from mercurial import obsolete
34 obsolete._enabled 35 obsolete._enabled
35 except ImportError: 36 except ImportError:
433 def __init__(cls, *args, **opts): 434 def __init__(cls, *args, **opts):
434 if cls.obsolete_mode_tests: 435 if cls.obsolete_mode_tests:
435 for origname in dir(cls): 436 for origname in dir(cls):
436 _obsolete_wrap(cls, origname) 437 _obsolete_wrap(cls, origname)
437 438
438 if cls.stupid_mode_tests: 439 if cls.stupid_mode_tests and svnwrap.subversion_version < (1, 9, 0):
439 for origname in dir(cls): 440 for origname in dir(cls):
440 _stupid_wrap(cls, origname) 441 _stupid_wrap(cls, origname)
441 442
442 return super(TestMeta, cls).__init__(*args, **opts) 443 return super(TestMeta, cls).__init__(*args, **opts)
443 444
763 summary: {desc|firstline} 764 summary: {desc|firstline}
764 files: {files} 765 files: {files}
765 766
766 """ 767 """
767 _ui.pushbuffer() 768 _ui.pushbuffer()
768 graphlog.graphlog(_ui, repo, rev=None, template=templ) 769 try:
770 graphlog.graphlog(_ui, repo, rev=None, template=templ)
771 except AttributeError:
772 from mercurial import commands
773 commands.log(_ui, repo, rev=None, template=templ, graph=True)
769 return _ui.popbuffer() 774 return _ui.popbuffer()
770 775
771 def draw(self, repo): 776 def draw(self, repo):
772 sys.stdout.write(self.getgraph(repo)) 777 sys.stdout.write(self.getgraph(repo))