Mercurial > hgsubversion
comparison tests/test_single_dir_clone.py @ 691:a45365f1492a
push: fix case where we get >1 revs back after svn commit
This hinges on looking not only at children(), but at descendants()
to find things.
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Wed, 08 Sep 2010 10:43:02 +0200 |
parents | d2ef7220a079 |
children | 3b8088de027d |
comparison
equal
deleted
inserted
replaced
690:4b55fb6d6847 | 691:a45365f1492a |
---|---|
132 self.pushrevisions() | 132 self.pushrevisions() |
133 self.assertNotEqual(before, self.repo['tip'].hex()) | 133 self.assertNotEqual(before, self.repo['tip'].hex()) |
134 self.assertEqual(self.repo['tip']['bogus'].data(), | 134 self.assertEqual(self.repo['tip']['bogus'].data(), |
135 'contents of bogus') | 135 'contents of bogus') |
136 | 136 |
137 def test_push_single_dir_one_incoming_and_two_outgoing(self): | |
138 # Tests simple pushing from default branch to a single dir repo | |
139 # Pushes two outgoing over one incoming svn rev | |
140 # (used to cause an "unknown revision") | |
141 # This can happen if someone committed to svn since our last pull (race). | |
142 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', | |
143 stupid=False, | |
144 layout='single', | |
145 subdir='trunk') | |
146 self._add_svn_rev({'trunk/alpha': 'Changed'}) | |
147 def file_callback(repo, memctx, path): | |
148 return context.memfilectx(path=path, | |
149 data='data of %s' % path, | |
150 islink=False, | |
151 isexec=False, | |
152 copied=False) | |
153 for fn in ['one', 'two']: | |
154 ctx = context.memctx(repo, | |
155 (repo['tip'].node(), node.nullid), | |
156 'automated test', | |
157 [fn], | |
158 file_callback, | |
159 'an_author', | |
160 '2009-10-19 18:49:30 -0500', | |
161 {'branch': 'default',}) | |
162 repo.commitctx(ctx) | |
163 hg.update(repo, repo['tip'].node()) | |
164 self.pushrevisions(expected_extra_back=1) | |
165 self.assertTrue('trunk/one' in self.svnls('')) | |
166 self.assertTrue('trunk/two' in self.svnls('')) | |
167 | |
137 def test_push_single_dir_branch(self): | 168 def test_push_single_dir_branch(self): |
138 # Tests local branches pushing to a single dir repo. Creates a fork at | 169 # Tests local branches pushing to a single dir repo. Creates a fork at |
139 # tip. The default branch adds a file called default, while branch foo | 170 # tip. The default branch adds a file called default, while branch foo |
140 # adds a file called foo, then tries to push the foo branch and default | 171 # adds a file called foo, then tries to push the foo branch and default |
141 # branch in that order. | 172 # branch in that order. |