comparison tests/test_push_command.py @ 150:58ae90a65f41

push: Improved the rebasing logic for push so that it doesn't break with keeping branch names during rebase.
author Augie Fackler <durin42@gmail.com>
date Mon, 22 Dec 2008 21:21:11 -0600
parents a3b717e4abf5
children 06eb60f9a026
comparison
equal deleted inserted replaced
149:04800fda7af5 150:58ae90a65f41
112 return # some tests use this test as an extended setup. 112 return # some tests use this test as an extended setup.
113 hg.update(repo, repo['tip'].node()) 113 hg.update(repo, repo['tip'].node())
114 self.pushrevisions() 114 self.pushrevisions()
115 tip = self.repo['tip'] 115 tip = self.repo['tip']
116 self.assertNotEqual(tip.node(), old_tip) 116 self.assertNotEqual(tip.node(), old_tip)
117 self.assertEqual(tip.parents()[0].node(), expected_parent) 117 self.assertEqual(node.hex(tip.parents()[0].node()),
118 node.hex(expected_parent))
118 self.assertEqual(tip['adding_file'].data(), 'foo') 119 self.assertEqual(tip['adding_file'].data(), 'foo')
119 self.assertEqual(tip.branch(), 'default') 120 self.assertEqual(tip.branch(), 'default')
121
122 def test_push_two_revs_different_local_branch(self):
123 def filectxfn(repo, memctx, path):
124 return context.memfilectx(path=path,
125 data=path,
126 islink=False,
127 isexec=False,
128 copied=False)
129 oldtiphash = self.repo['default'].node()
130 ctx = context.memctx(self.repo,
131 (self.repo[0].node(), revlog.nullid, ),
132 'automated test',
133 ['gamma', ],
134 filectxfn,
135 'testy',
136 '2008-12-21 16:32:00 -0500',
137 {'branch': 'localbranch', })
138 newhash = self.repo.commitctx(ctx)
139 ctx = context.memctx(self.repo,
140 (newhash, revlog.nullid),
141 'automated test2',
142 ['delta', ],
143 filectxfn,
144 'testy',
145 '2008-12-21 16:32:00 -0500',
146 {'branch': 'localbranch', })
147 newhash = self.repo.commitctx(ctx)
148 repo = self.repo
149 hg.update(repo, newhash)
150 push_cmd.push_revisions_to_subversion(ui.ui(),
151 repo=repo,
152 svn_url=test_util.fileurl(self.repo_path),
153 hg_repo_path=self.wc_path)
154 self.assertEqual(self.repo['tip'].parents()[0].parents()[0].node(), oldtiphash)
155 self.assertEqual(self.repo['tip'].files(), ['delta', ])
156 self.assertEqual(self.repo['tip'].manifest().keys(),
157 ['alpha', 'beta', 'gamma', 'delta'])
120 158
121 def test_push_two_revs(self): 159 def test_push_two_revs(self):
122 # set up some work for us 160 # set up some work for us
123 self.test_push_to_default(commit=False) 161 self.test_push_to_default(commit=False)
124 repo = self.repo 162 repo = self.repo