2018-01-17 14:23:44 +03:00
|
|
|
import test_hgsubversion_util
|
2010-07-14 17:39:18 +04:00
|
|
|
|
2009-05-15 21:18:43 +04:00
|
|
|
from mercurial import commands
|
|
|
|
from mercurial import hg
|
|
|
|
|
2018-01-17 14:23:44 +03:00
|
|
|
class TestFetchTruncatedHistory(test_hgsubversion_util.TestBase):
|
2013-08-10 01:45:56 +04:00
|
|
|
stupid_mode_tests = True
|
|
|
|
|
|
|
|
def test_truncated_history(self):
|
2009-05-15 21:18:43 +04:00
|
|
|
# Test repository does not follow the usual layout
|
2012-04-19 20:29:28 +04:00
|
|
|
repo_path = self.load_svndump('truncatedhistory.svndump')
|
2018-01-17 14:23:44 +03:00
|
|
|
svn_url = test_hgsubversion_util.fileurl(repo_path + '/project2')
|
2013-08-10 01:45:56 +04:00
|
|
|
commands.clone(self.ui(), svn_url, self.wc_path, noupdate=True)
|
|
|
|
repo = hg.repository(self.ui(), self.wc_path)
|
2009-05-15 21:18:43 +04:00
|
|
|
|
|
|
|
# We are converting /project2/trunk coming from:
|
|
|
|
#
|
|
|
|
# Changed paths:
|
|
|
|
# D /project1
|
|
|
|
# A /project2/trunk (from /project1:2)
|
|
|
|
#
|
|
|
|
# Here a full fetch should be performed since we are starting
|
|
|
|
# the conversion on an already filled branch.
|
|
|
|
tip = repo['tip']
|
|
|
|
files = tip.manifest().keys()
|
|
|
|
files.sort()
|
|
|
|
self.assertEqual(files, ['a', 'b'])
|
|
|
|
self.assertEqual(repo['tip']['a'].data(), 'a\n')
|
2018-01-17 14:23:44 +03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import silenttestrunner
|
|
|
|
silenttestrunner.main(__name__)
|
|
|
|
|