comparison tests/test_fetch_renames.py @ 1255:139a44a63090 stable 1.7

Merge default into stable for a release.
author Augie Fackler <raf@durin42.com>
date Wed, 05 Nov 2014 12:48:59 -0500
parents 6b15eeb78c1a
children 4379baf58f9e
comparison
equal deleted inserted replaced
1230:807c443928d4 1255:139a44a63090
16 w('%s: %r %r\n' % (f, fctx.data(), fctx.renamed())) 16 w('%s: %r %r\n' % (f, fctx.data(), fctx.renamed()))
17 17
18 def test_rename(self): 18 def test_rename(self):
19 config = { 19 config = {
20 'hgsubversion.filestoresize': '0', 20 'hgsubversion.filestoresize': '0',
21 # we set this because we expect all of the copies to be
22 # handled via replay, and we want to notice if that
23 # changes.
24 'hgsubversion.failonmissing': 'yes',
21 } 25 }
22 repo = self._load_fixture_and_fetch('renames.svndump', config=config) 26 repo = self._load_fixture_and_fetch('renames.svndump', config=config)
27 self._run_assertions(repo)
23 28
29 def test_rename_with_prefix(self):
30 config = {
31 'hgsubversion.filestoresize': '0',
32 'hgsubversion.failonmissing': 'yes',
33 }
34 repo = self._load_fixture_and_fetch('renames_with_prefix.svndump',
35 subdir='prefix',
36 config=config)
37 self._run_assertions(repo)
38
39 def _run_assertions(self, repo):
24 # Map revnum to mappings of dest name to (source name, dest content) 40 # Map revnum to mappings of dest name to (source name, dest content)
25 copies = { 41 copies = {
26 4: { 42 4: {
27 'a1': ('a', 'a\n'), 43 'a1': ('a', 'a\n'),
44 'linka1': ('linka', 'a'),
28 'a2': ('a', 'a\n'), 45 'a2': ('a', 'a\n'),
46 'linka2': ('linka', 'a'),
29 'b1': ('b', 'b\nc\n'), 47 'b1': ('b', 'b\nc\n'),
48 'linkb1': ('linkb', 'bc'),
30 'da1/daf': ('da/daf', 'c\n'), 49 'da1/daf': ('da/daf', 'c\n'),
50 'da1/dalink': ('da/dalink', 'daf'),
31 'da1/db/dbf': ('da/db/dbf', 'd\n'), 51 'da1/db/dbf': ('da/db/dbf', 'd\n'),
52 'da1/db/dblink': ('da/db/dblink', '../daf'),
32 'da2/daf': ('da/daf', 'c\n'), 53 'da2/daf': ('da/daf', 'c\n'),
54 'da2/dalink': ('da/dalink', 'daf'),
33 'da2/db/dbf': ('da/db/dbf', 'd\n'), 55 'da2/db/dbf': ('da/db/dbf', 'd\n'),
56 'da2/db/dblink': ('da/db/dblink', '../daf'),
34 }, 57 },
35 5: { 58 5: {
36 'c1': ('c', 'c\nc\n'), 59 'c1': ('c', 'c\nc\n'),
60 'linkc1': ('linkc', 'cc'),
37 }, 61 },
38 9: { 62 9: {
39 'unchanged2': ('unchanged', 'unchanged\n'), 63 'unchanged2': ('unchanged', 'unchanged\n'),
64 'unchangedlink2': ('unchangedlink', 'unchanged'),
40 'unchangeddir2/f': ('unchangeddir/f', 'unchanged2\n'), 65 'unchangeddir2/f': ('unchangeddir/f', 'unchanged2\n'),
66 'unchangeddir2/link': ('unchangeddir/link', 'f'),
41 }, 67 },
42 10: { 68 10: {
43 'groupdir2/b': ('groupdir/b', 'b\n') 69 'groupdir2/b': ('groupdir/b', 'b\n'),
70 'groupdir2/linkb': ('groupdir/linkb', 'b'),
44 }, 71 },
45 } 72 }
46 for rev in repo: 73 for rev in repo:
47 ctx = repo[rev] 74 ctx = repo[rev]
48 copymap = copies.get(rev, {}) 75 copymap = copies.get(rev, {})