comparison tests/test_utility_commands.py @ 347:537de0300510

Remove the 'outgoing' wrapper, and use the Mercurial infrastructure instead.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Fri, 22 May 2009 15:12:31 +0200
parents 46e69be8e2c8
children 37c96b78b8c0
comparison
equal deleted inserted replaced
346:4b992ebdecc6 347:537de0300510
5 from mercurial import ui 5 from mercurial import ui
6 from mercurial import hg 6 from mercurial import hg
7 from mercurial import revlog 7 from mercurial import revlog
8 from mercurial import context 8 from mercurial import context
9 from mercurial import node 9 from mercurial import node
10 from mercurial import commands
10 11
11 from hgsubversion import util 12 from hgsubversion import util
12 from hgsubversion import utility_commands 13 from hgsubversion import utility_commands
13 import test_util 14 import test_util
14 from hgsubversion import wrappers 15 from hgsubversion import wrappers
109 'summary: Add gamma on trunk.\n\n') 110 'summary: Add gamma on trunk.\n\n')
110 111
111 def test_outgoing_output(self): 112 def test_outgoing_output(self):
112 self._load_fixture_and_fetch('two_heads.svndump') 113 self._load_fixture_and_fetch('two_heads.svndump')
113 u = ui.ui() 114 u = ui.ui()
114 u.pushbuffer()
115 parents = (self.repo['the_branch'].node(), revlog.nullid, ) 115 parents = (self.repo['the_branch'].node(), revlog.nullid, )
116 def filectxfn(repo, memctx, path): 116 def filectxfn(repo, memctx, path):
117 return context.memfilectx(path=path, 117 return context.memfilectx(path=path,
118 data='added', 118 data='added',
119 islink=False, 119 islink=False,
127 'testy', 127 'testy',
128 '2008-12-21 16:32:00 -0500', 128 '2008-12-21 16:32:00 -0500',
129 {'branch': 'localbranch', }) 129 {'branch': 'localbranch', })
130 new = self.repo.commitctx(ctx) 130 new = self.repo.commitctx(ctx)
131 hg.update(self.repo, new) 131 hg.update(self.repo, new)
132 wrappers.outgoing(lambda x,y,z: None, u, self.repo, svn=True) 132 u.pushbuffer()
133 actual = u.popbuffer() 133 commands.outgoing(u, self.repo, self.repourl)
134 self.assert_(node.hex(self.repo['localbranch'].node())[:8] in actual) 134 actual = u.popbuffer()
135 self.assertEqual(actual, ('changeset: 5:6de15430fa20\n' 135 u.write(actual)
136 'branch: localbranch\n' 136 self.assertTrue(node.hex(self.repo['localbranch'].node())[:8] in actual)
137 'tag: tip\n' 137 actual = actual.splitlines()
138 'parent: 3:4e256962fc5d\n' 138 self.assertEqual(actual[0], 'comparing with ' + self.repourl)
139 'user: testy\n' 139 self.assertEqual(actual[1], 'changeset: 5:6de15430fa20')
140 'date: Sun Dec 21 16:32:00 2008 -0500\n' 140 self.assertEqual(actual[2], 'branch: localbranch')
141 'summary: automated test\n' 141 self.assertEqual(actual[3], 'tag: tip')
142 '\n')) 142 self.assertEqual(actual[4], 'parent: 3:4e256962fc5d')
143 self.assertEqual(actual[5], 'user: testy')
144 self.assertEqual(actual[6], 'date: Sun Dec 21 16:32:00 2008 -0500')
145 self.assertEqual(actual[7], 'summary: automated test')
143 hg.update(self.repo, 'default') 146 hg.update(self.repo, 'default')
144 u.pushbuffer() 147 u.pushbuffer()
145 wrappers.outgoing(lambda x,y,z: None, u, self.repo, svn=True) 148 commands.outgoing(u, self.repo, self.repourl)
146 actual = u.popbuffer() 149 actual = u.popbuffer()
147 self.assertEqual(actual, 'no changes found\n') 150 u.write(actual)
151 self.assertEqual(actual.splitlines()[1], 'no changes found')
148 152
149 def test_rebase(self): 153 def test_rebase(self):
150 self._load_fixture_and_fetch('two_revs.svndump') 154 self._load_fixture_and_fetch('two_revs.svndump')
151 parents = (self.repo[0].node(), revlog.nullid, ) 155 parents = (self.repo[0].node(), revlog.nullid, )
152 def filectxfn(repo, memctx, path): 156 def filectxfn(repo, memctx, path):