Mercurial > hgsubversion
comparison tests/test_template_keywords.py @ 1177:8caf1226adec stable 1.6.1
test_template_keywords: handle changeset output ordering change in hg 3.0
hg change 69402eb72115 caused commands.log to produce a more sensible
ordering for this log invocation (namely, it now matches the graphlog
ordering). In order to portably test across hg versions, use graphlog
output to test these keyword functions.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 02 May 2014 09:27:31 -0400 |
parents | d741f536f23a |
children |
comparison
equal
deleted
inserted
replaced
1176:97a064e2075d | 1177:8caf1226adec |
---|---|
28 | 28 |
29 | 29 |
30 class TestLogKeywords(test_util.TestBase): | 30 class TestLogKeywords(test_util.TestBase): |
31 @test_util.requiresmodule(templatekw) | 31 @test_util.requiresmodule(templatekw) |
32 def test_svn_keywords(self): | 32 def test_svn_keywords(self): |
33 defaults = {'date': None, 'rev': None, 'user': None} | 33 defaults = {'date': None, 'rev': None, 'user': None, 'graph': True} |
34 repo = self._load_fixture_and_fetch('two_revs.svndump') | 34 repo = self._load_fixture_and_fetch('two_revs.svndump') |
35 | 35 |
36 # we want one commit that isn't from Subversion | 36 # we want one commit that isn't from Subversion |
37 self.commitchanges([('foo', 'foo', 'frobnicate\n')]) | 37 self.commitchanges([('foo', 'foo', 'frobnicate\n')]) |
38 | 38 |
39 ui = CapturingUI() | 39 ui = CapturingUI() |
40 commands.log(ui, repo, template='{rev}:{svnrev} ', **defaults) | 40 commands.log(ui, repo, template=(' rev: {rev} svnrev:{svnrev} ' |
41 self.assertEqual(ui._output, '0:2 1:3 2: ') | 41 'svnpath:{svnpath} svnuuid:{svnuuid}\n'), |
42 ui = CapturingUI() | 42 **defaults) |
43 commands.log(ui, repo, template='{rev}:{svnpath} ', **defaults) | 43 print ui._output |
44 self.assertEqual(ui._output, '0:/trunk 1:/trunk 2: ') | 44 self.assertEqual(ui._output.strip(), ''' |
45 ui = CapturingUI() | 45 rev: 2 svnrev: svnpath: svnuuid: |
46 commands.log(ui, repo, template='{rev}:{svnuuid} ', **defaults) | 46 @ |
47 self.assertEqual(ui._output, | 47 | |
48 ('0:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' | 48 rev: 1 svnrev:3 svnpath:/trunk svnuuid:df2126f7-00ab-4d49-b42c-7e981dde0bcf |
49 '1:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' | 49 o |
50 '2: ')) | 50 | |
51 rev: 0 svnrev:2 svnpath:/trunk svnuuid:df2126f7-00ab-4d49-b42c-7e981dde0bcf | |
52 o | |
53 '''.strip()) | |
51 | 54 |
52 @test_util.requiresmodule(revset) | 55 @test_util.requiresmodule(revset) |
53 @test_util.requiresmodule(templatekw) | 56 @test_util.requiresmodule(templatekw) |
54 def test_svn_revsets(self): | 57 def test_svn_revsets(self): |
55 repo = self._load_fixture_and_fetch('two_revs.svndump') | 58 repo = self._load_fixture_and_fetch('two_revs.svndump') |