Mercurial > hgsubversion
comparison tests/test_externals.py @ 785:40ddf8213fa2
pushmod: do not delete the whole branch when deleting .hgsub
When deleting .hgsub, and only .hgsub, the root directory '' was marked as
changed. Since it was not listed in the existing directory list, this single
record was enough to trigger a deletion of the current branch. We changed the
directory parser to always emit the '' element.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 13 Feb 2011 20:14:01 +0100 |
parents | f214fb3f92cd |
children | a5be5ca638de |
comparison
equal
deleted
inserted
replaced
784:f214fb3f92cd | 785:40ddf8213fa2 |
---|---|
360 self.assertchanges(changes, self.repo['tip']) | 360 self.assertchanges(changes, self.repo['tip']) |
361 # Check subdir2/a is still there even if the externals were removed | 361 # Check subdir2/a is still there even if the externals were removed |
362 self.assertTrue('subdir2/a' in self.repo['tip']) | 362 self.assertTrue('subdir2/a' in self.repo['tip']) |
363 self.assertTrue('subdir1/a' not in self.repo['tip']) | 363 self.assertTrue('subdir1/a' not in self.repo['tip']) |
364 | 364 |
365 # Move the externals so they are defined on the base directory, | |
366 # this used to cause full branch removal when deleting the .hgsub | |
367 changes = [ | |
368 ('.hgsub', '.hgsub', """\ | |
369 subdir1/deps/project1 = [hgsubversion] :^/externals/project1 subdir1/deps/project1 | |
370 """), | |
371 ('.hgsubstate', '.hgsubstate', """\ | |
372 HEAD subdir1/deps/project1 | |
373 """), | |
374 ] | |
375 self.commitchanges(changes) | |
376 self.pushrevisions(stupid) | |
377 self.assertchanges(changes, self.repo['tip']) | |
378 | |
365 # Test externals removal | 379 # Test externals removal |
366 changes = [ | 380 changes = [ |
367 ('.hgsub', None, None), | 381 ('.hgsub', None, None), |
368 ('.hgsubstate', None, None), | 382 ('.hgsubstate', None, None), |
369 ] | 383 ] |