Mercurial > hgsubversion
comparison tests/test_util.py @ 1367:5ddb35c31097
Merge with stable.
This includes the force-disabling of stupid mode on Subversion 1.9 and
later.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Thu, 31 Dec 2015 12:52:49 -0500 |
parents | 89997a5fc181 |
children | 019c3e194fba bac709b5ff6c |
comparison
equal
deleted
inserted
replaced
1362:a279eb7185d4 | 1367:5ddb35c31097 |
---|---|
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: |
356 args = ['svn', 'propget', '-r', str(rev), prop, path] | 357 args = ['svn', 'propget', '-r', str(rev), prop, path] |
357 p = subprocess.Popen(args, | 358 p = subprocess.Popen(args, |
358 stdout=subprocess.PIPE, | 359 stdout=subprocess.PIPE, |
359 stderr=subprocess.STDOUT) | 360 stderr=subprocess.STDOUT) |
360 stdout, stderr = p.communicate() | 361 stdout, stderr = p.communicate() |
361 if p.returncode: | 362 if p.returncode and stderr: |
362 raise Exception('svn ls failed on %s: %r' % (path, stderr)) | 363 raise Exception('svn ls failed on %s: %r' % (path, stderr)) |
364 if 'W200017' in stdout: | |
365 # subversion >= 1.9 changed 'no properties' to be an error, so let's | |
366 # avoid that | |
367 return '' | |
363 return stdout.strip() | 368 return stdout.strip() |
364 | 369 |
365 | 370 |
366 def _obsolete_wrap(cls, name): | 371 def _obsolete_wrap(cls, name): |
367 origfunc = getattr(cls, name) | 372 origfunc = getattr(cls, name) |
429 def __init__(cls, *args, **opts): | 434 def __init__(cls, *args, **opts): |
430 if cls.obsolete_mode_tests: | 435 if cls.obsolete_mode_tests: |
431 for origname in dir(cls): | 436 for origname in dir(cls): |
432 _obsolete_wrap(cls, origname) | 437 _obsolete_wrap(cls, origname) |
433 | 438 |
434 if cls.stupid_mode_tests: | 439 if cls.stupid_mode_tests and svnwrap.subversion_version < (1, 9, 0): |
435 for origname in dir(cls): | 440 for origname in dir(cls): |
436 _stupid_wrap(cls, origname) | 441 _stupid_wrap(cls, origname) |
437 | 442 |
438 return super(TestMeta, cls).__init__(*args, **opts) | 443 return super(TestMeta, cls).__init__(*args, **opts) |
439 | 444 |
759 summary: {desc|firstline} | 764 summary: {desc|firstline} |
760 files: {files} | 765 files: {files} |
761 | 766 |
762 """ | 767 """ |
763 _ui.pushbuffer() | 768 _ui.pushbuffer() |
764 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) | |
765 return _ui.popbuffer() | 774 return _ui.popbuffer() |
766 | 775 |
767 def draw(self, repo): | 776 def draw(self, repo): |
768 sys.stdout.write(self.getgraph(repo)) | 777 sys.stdout.write(self.getgraph(repo)) |