~cjwatson/brz-svn/fix-http-probe

« back to all changes in this revision

Viewing changes to tests/test_fetch.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-03 09:16:45 UTC
  • Revision ID: jelmer@jelmer.uk-20200203091645-q0f1yq77zkr1s3cz
More Python3 / formatting / breezy fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    mutter,
52
52
    )
53
53
 
54
 
from breezy.plugins.svn import (
 
54
from .. import (
55
55
    remote,
56
56
    )
57
 
from breezy.plugins.svn.convert import (
 
57
from ..convert import (
58
58
    load_dumpfile,
59
59
    )
60
 
from breezy.plugins.svn.errors import (
 
60
from ..errors import (
61
61
    InvalidFileName,
62
62
    SymlinkTargetContainsNewline,
63
63
    )
64
 
from breezy.plugins.svn.fetch import (
 
64
from ..fetch import (
65
65
   FetchRevisionFinder,
66
66
   InterFromSvnToInventoryRepository,
67
67
   check_filename,
68
68
   chunks_start_with_link,
69
69
   )
70
 
from breezy.plugins.svn.layout.standard import (
 
70
from ..layout.standard import (
71
71
    RootLayout,
72
72
    TrunkLayout,
73
73
    )
74
 
from breezy.plugins.svn.mapping import (
 
74
from ..mapping import (
75
75
    SVN_REVPROP_BZR_MAPPING_VERSION,
76
76
    SVN_REVPROP_BZR_ROOT,
77
77
    )
78
 
from breezy.plugins.svn.tests import (
 
78
from . import (
79
79
    SubversionTestCase,
80
80
    )
81
 
from breezy.plugins.svn.transport import (
 
81
from ..transport import (
82
82
    SvnRaTransport,
83
83
    )
84
84
 
105
105
        dc = self.get_commit_editor(repos_url)
106
106
        proj1 = dc.add_dir("proj1")
107
107
        trunk = proj1.add_dir("proj1/trunk")
108
 
        trunk.add_file("proj1/trunk/file").modify("data")
 
108
        trunk.add_file("proj1/trunk/file").modify(b"data")
109
109
        dc.close()
110
110
 
111
111
        oldrepos = Repository.open(repos_url)
121
121
        t = dc.add_dir("trunk")
122
122
        ch = t.add_dir("trunk/check")
123
123
        ch.add_dir("trunk/check/debian")
124
 
        ch.add_file("trunk/check/stamp-h.in").modify("foo")
 
124
        ch.add_file("trunk/check/stamp-h.in").modify(b"foo")
125
125
        dc.add_dir("tags")
126
126
        dc.close() #1
127
127
 
129
129
        t = dc.open_dir("trunk")
130
130
        ch = t.open_dir("trunk/check")
131
131
        deb = ch.open_dir("trunk/check/debian")
132
 
        deb.add_file("trunk/check/debian/pl").modify("bar")
 
132
        deb.add_file("trunk/check/debian/pl").modify(b"bar")
133
133
        dc.close() #2
134
134
 
135
135
        dc = self.get_commit_editor(repos_url)
136
136
        t = dc.open_dir("trunk")
137
137
        ch = t.open_dir("trunk/check")
138
138
        deb = ch.open_dir("trunk/check/debian")
139
 
        deb.add_file("trunk/check/debian/voo").modify("bar")
 
139
        deb.add_file("trunk/check/debian/voo").modify(b"bar")
140
140
        dc.close() #3
141
141
 
142
142
        dc = self.get_commit_editor(repos_url)
143
143
        t = dc.open_dir("trunk")
144
144
        ch = t.open_dir("trunk/check")
145
145
        deb = ch.open_dir("trunk/check/debian")
146
 
        deb.add_file("trunk/check/debian/blie").modify("oeh")
 
146
        deb.add_file("trunk/check/debian/blie").modify(b"oeh")
147
147
        dc.close() #4
148
148
 
149
149
        dc = self.get_commit_editor(repos_url)
150
150
        t = dc.open_dir("trunk")
151
151
        ch = t.open_dir("trunk/check")
152
152
        deb = ch.open_dir("trunk/check/debian")
153
 
        deb.add_file("trunk/check/debian/bar").modify("oeh")
154
 
        ch.add_file("trunk/check/bar").modify("bla")
 
153
        deb.add_file("trunk/check/debian/bar").modify(b"oeh")
 
154
        ch.add_file("trunk/check/bar").modify(b"bla")
155
155
        dc.close() #5
156
156
 
157
157
        self.make_checkout(repos_url, "dc")
179
179
 
180
180
        dc = self.get_commit_editor(repos_url)
181
181
        trunk = dc.add_dir("trunk")
182
 
        trunk.add_file("trunk/file\\part").modify("data")
 
182
        trunk.add_file("trunk/file\\part").modify(b"data")
183
183
        dc.close()
184
184
 
185
185
        oldrepos = Repository.open(repos_url)
225
225
 
226
226
        dc = self.get_commit_editor(repos_url)
227
227
        trunk = dc.add_dir("trunk")
228
 
        trunk.add_file(u"trunk/f\x2cle".encode("utf-8")).modify("data")
 
228
        trunk.add_file(u"trunk/f\x2cle".encode("utf-8")).modify(b"data")
229
229
        dc.close()
230
230
 
231
231
        oldrepos = Repository.open(repos_url)
238
238
        repos_url = self.make_svn_repository('d')
239
239
        dc = self.get_commit_editor(repos_url)
240
240
        trunk = dc.add_dir("trunk")
241
 
        trunk.add_file("trunk/bar").modify("data")
 
241
        trunk.add_file("trunk/bar").modify(b"data")
242
242
        dc.close()
243
243
        self.client_set_revprop(repos_url, 1, "bzr:gpg-signature", "SIGNATURE")
244
244
        oldrepos = Repository.open(repos_url)
259
259
 
260
260
        dc = self.get_commit_editor(repos_url)
261
261
        trunk = dc.add_dir("trunk")
262
 
        trunk.add_file("trunk/bar").modify("data")
 
262
        trunk.add_file("trunk/bar").modify(b"data")
263
263
        dc.close()
264
264
 
265
265
        dc = self.get_commit_editor(repos_url)
302
302
 
303
303
        dc = self.get_commit_editor(repos_url)
304
304
        trunk = dc.open_dir("trunk")
305
 
        trunk.add_file(u'trunk/IöC/bar'.encode("utf-8")).modify("more data")
 
305
        trunk.add_file(u'trunk/IöC/bar'.encode("utf-8")).modify(b"more data")
306
306
        dc.close()
307
307
 
308
308
        oldrepos = Repository.open(repos_url)
317
317
        dc = self.get_commit_editor(repos_url)
318
318
        trunk = dc.add_dir("trunk")
319
319
        raardir = trunk.add_dir(u"trunk/é".encode("utf-8"))
320
 
        raardir.add_file(u'trunk/é/f\x2cle'.encode("utf-8")).modify("data")
 
320
        raardir.add_file(u'trunk/é/f\x2cle'.encode("utf-8")).modify(b"data")
321
321
        dc.close()
322
322
        oldrepos = Repository.open(repos_url)
323
323
        oldrepos.set_layout(TrunkLayout(0))
330
330
 
331
331
        dc = self.get_commit_editor(repos_url)
332
332
        trunk = dc.add_dir("trunk")
333
 
        trunk.add_file(u"trunk/€\x2c".encode("utf-8")).modify("data")
 
333
        trunk.add_file(u"trunk/€\x2c".encode("utf-8")).modify(b"data")
334
334
        dc.close()
335
335
 
336
336
        dc = self.get_commit_editor(repos_url)
337
337
        trunk = dc.open_dir("trunk")
338
 
        dc.open_file(u"trunk/€\x2c".encode("utf-8")).modify("bar")
 
338
        dc.open_file(u"trunk/€\x2c".encode("utf-8")).modify(b"bar")
339
339
        dc.close()
340
340
 
341
341
        oldrepos = Repository.open(repos_url)
349
349
 
350
350
        dc = self.get_commit_editor(repos_url)
351
351
        foo = dc.add_dir("foo")
352
 
        foo.add_file("foo/bla").modify("data")
 
352
        foo.add_file("foo/bla").modify(b"data")
353
353
        dc.close()
354
354
        oldrepos = Repository.open(repos_url)
355
355
        dir = ControlDir.create("f")
371
371
 
372
372
        dc = self.get_commit_editor(repos_url)
373
373
        foo = dc.add_dir("foo")
374
 
        foo.add_file("foo/bla").modify("data")
 
374
        foo.add_file("foo/bla").modify(b"data")
375
375
        dc.close()
376
376
 
377
377
        dc = self.get_commit_editor(repos_url)
394
394
 
395
395
        dc = self.get_commit_editor(repos_url)
396
396
        foo = dc.add_dir("foo")
397
 
        foo.add_file("foo/bla").modify("data")
 
397
        foo.add_file("foo/bla").modify(b"data")
398
398
        dc.close()
399
399
 
400
400
        dc = self.get_commit_editor(repos_url)
401
401
        foo = dc.open_dir("foo")
402
 
        foo.add_file("foo/blo").modify("data2")
403
 
        foo.open_file("foo/bla").modify("data")
 
402
        foo.add_file("foo/blo").modify(b"data2")
 
403
        foo.open_file("foo/bla").modify(b"data")
404
404
        bar = dc.add_dir("bar")
405
 
        bar.add_file("bar/foo").modify("data3")
 
405
        bar.add_file("bar/foo").modify(b"data3")
406
406
        dc.close()
407
407
 
408
408
        oldrepos = Repository.open(repos_url)
430
430
        dc = self.get_commit_editor(repos_url)
431
431
        br1 = dc.add_dir("trunk")
432
432
        br2 = br1.add_dir("trunk/bloe")
433
 
        br2.add_file("trunk/bloe/README").modify("BLA")
 
433
        br2.add_file("trunk/bloe/README").modify(b"BLA")
434
434
        dc.close()
435
435
 
436
436
        old_mapping = BzrSvnMappingv3(TrunkBranchingScheme(0))
438
438
        self.client_set_revprop(repos_url, 1, SVN_REVPROP_BZR_ROOT, "trunk")
439
439
 
440
440
        dc = self.get_commit_editor(repos_url)
441
 
        dc.open_dir("trunk").add_file("trunk/a").modify("LA")
 
441
        dc.open_dir("trunk").add_file("trunk/a").modify(b"LA")
442
442
        dc.close()
443
443
 
444
444
        oldrepos = Repository.open(repos_url)
457
457
        dc = self.get_commit_editor(repos_url)
458
458
        br1 = dc.add_dir("branch1")
459
459
        br2 = br1.add_dir("branch1/bloe")
460
 
        br2.add_file("branch1/bloe/README").modify("BLA")
 
460
        br2.add_file("branch1/bloe/README").modify(b"BLA")
461
461
        dc.close()
462
462
 
463
463
        dc = self.get_commit_editor(repos_url)
468
468
        dc = self.get_commit_editor(repos_url)
469
469
        br1 = dc.open_dir("branch2")
470
470
        bloe = br1.open_dir("branch2/bloe")
471
 
        bloe.open_file("branch2/bloe/README").modify("TEST")
 
471
        bloe.open_file("branch2/bloe/README").modify(b"TEST")
472
472
        dc.close()
473
473
 
474
474
        oldrepos = Repository.open(repos_url)
486
486
        repos_url = self.make_svn_repository('d')
487
487
 
488
488
        dc = self.get_commit_editor(repos_url)
489
 
        dc.add_file("bla").modify("data")
 
489
        dc.add_file("bla").modify(b"data")
490
490
        dc.close()
491
491
 
492
492
        dc = self.get_commit_editor(repos_url)
493
493
        dc.delete('bla')
494
 
        dc.add_file("bla").modify("data2")
 
494
        dc.add_file("bla").modify(b"data2")
495
495
        dc.close()
496
496
 
497
497
        oldrepos = Repository.open(repos_url)
516
516
        dc = self.get_commit_editor(repos_url)
517
517
        trunk = dc.add_dir("trunk")
518
518
        mydir = trunk.add_dir("trunk/mydir")
519
 
        mydir.add_file("trunk/mydir/a").modify("data")
 
519
        mydir.add_file("trunk/mydir/a").modify(b"data")
520
520
        dc.close()
521
521
 
522
522
        dc = self.get_commit_editor(repos_url)
1484
1484
        dc = self.get_commit_editor(repos_url)
1485
1485
        old_trunk = dc.add_dir("old-trunk")
1486
1486
        lib = old_trunk.add_dir("old-trunk/lib")
1487
 
        lib.add_file("old-trunk/lib/file").modify("data")
 
1487
        lib.add_file("old-trunk/lib/file").modify(b"data")
1488
1488
        dc.close()
1489
1489
 
1490
1490
        dc = self.get_commit_editor(repos_url)
1508
1508
        dc = self.get_commit_editor(repos_url)
1509
1509
        ot = dc.add_dir("old-trunk")
1510
1510
        lib = ot.add_dir("old-trunk/lib")
1511
 
        lib.add_file("old-trunk/lib/file").modify("data")
 
1511
        lib.add_file("old-trunk/lib/file").modify(b"data")
1512
1512
        dc.close()
1513
1513
 
1514
1514
        dc = self.get_commit_editor(repos_url)
1531
1531
 
1532
1532
        dc = self.get_commit_editor(repos_url)
1533
1533
        trunk = dc.add_dir("trunk")
1534
 
        trunk.add_file("trunk/file").modify("data")
 
1534
        trunk.add_file("trunk/file").modify(b"data")
1535
1535
        dc.close()
1536
1536
 
1537
1537
        dc = self.get_commit_editor(repos_url)
1596
1596
 
1597
1597
        dc = self.get_commit_editor(repos_url)
1598
1598
        trunk = dc.add_dir('trunk')
1599
 
        trunk.add_file("trunk/hosts").modify("hej1")
 
1599
        trunk.add_file("trunk/hosts").modify(b"hej1")
1600
1600
        dc.close()
1601
1601
 
1602
1602
        dc = self.get_commit_editor(repos_url)
1631
1631
 
1632
1632
        dc = self.get_commit_editor(repos_url)
1633
1633
        trunk = dc.open_dir("trunk")
1634
 
        trunk.open_file("trunk/hosts").modify("hej2")
 
1634
        trunk.open_file("trunk/hosts").modify(b"hej2")
1635
1635
        dc.close()
1636
1636
 
1637
1637
        dc = self.get_commit_editor(repos_url)
1638
1638
        trunk = dc.open_dir("trunk")
1639
 
        trunk.open_file("trunk/hosts").modify("hej3")
 
1639
        trunk.open_file("trunk/hosts").modify(b"hej3")
1640
1640
        dc.close()
1641
1641
 
1642
1642
        dc = self.get_commit_editor(repos_url)
1666
1666
 
1667
1667
        dc = self.get_commit_editor(repos_url)
1668
1668
        f = dc.add_file("bla")
1669
 
        f.modify("data")
 
1669
        f.modify(b"data")
1670
1670
        f.change_prop("svn:executable", "*")
1671
1671
        dc.close()
1672
1672
 
1693
1693
        bla.modify('data')
1694
1694
        bla.change_prop("svn:executable", "*")
1695
1695
        blie = dc.add_file("blie")
1696
 
        blie.modify("data2")
 
1696
        blie.modify(b"data2")
1697
1697
        blie.change_prop("svn:executable", "")
1698
1698
        dc.close()
1699
1699
 
1720
1720
        dc.close()
1721
1721
 
1722
1722
        dc = self.get_commit_editor(repos_url)
1723
 
        dc.open_file("bla").modify("data2")
 
1723
        dc.open_file("bla").modify(b"data2")
1724
1724
        dc.close()
1725
1725
 
1726
1726
        oldrepos = Repository.open(repos_url)
1741
1741
        repos_url = self.make_svn_repository('d')
1742
1742
 
1743
1743
        dc = self.get_commit_editor(repos_url)
1744
 
        dc.add_file("bla").modify("data")
 
1744
        dc.add_file("bla").modify(b"data")
1745
1745
        l = dc.add_file("mylink")
1746
 
        l.modify("link bla")
 
1746
        l.modify(b"link bla")
1747
1747
        l.change_prop("svn:special", "*")
1748
1748
        dc.close()
1749
1749
 
1771
1771
        repos_url = self.make_svn_repository('d')
1772
1772
 
1773
1773
        dc = self.get_commit_editor(repos_url)
1774
 
        dc.add_file("bla").modify("data")
 
1774
        dc.add_file("bla").modify(b"data")
1775
1775
        l = dc.add_file("mylink")
1776
 
        l.modify("link bla\nbar\nbla")
 
1776
        l.modify(b"link bla\nbar\nbla")
1777
1777
        l.change_prop("svn:special", "*")
1778
1778
        dc.close()
1779
1779
 
1799
1799
 
1800
1800
        dc = self.get_commit_editor(repos_url)
1801
1801
        l = dc.add_file("mylink")
1802
 
        l.modify("")
 
1802
        l.modify(b"")
1803
1803
        l.change_prop("svn:special", "*")
1804
1804
        dc.close()
1805
1805
 
1820
1820
 
1821
1821
        dc = self.get_commit_editor(repos_url)
1822
1822
        l = dc.add_file("mylink")
1823
 
        l.modify("link bla")
 
1823
        l.modify(b"link bla")
1824
1824
        l.change_prop("svn:special", "*")
1825
1825
        dc.close()
1826
1826
 
1827
1827
        dc = self.get_commit_editor(repos_url)
1828
1828
        l = dc.open_file("mylink")
1829
 
        l.modify("bloebla")
 
1829
        l.modify(b"bloebla")
1830
1830
        dc.close()
1831
1831
 
1832
1832
        oldrepos = Repository.open(repos_url)
1861
1861
        dc = self.get_commit_editor(repos_url)
1862
1862
        l = dc.add_file("mylink")
1863
1863
        l.change_prop("svn:special", "*")
1864
 
        l.modify("bloebla")
 
1864
        l.modify(b"bloebla")
1865
1865
        dc.close()
1866
1866
 
1867
1867
        dc = self.get_commit_editor(repos_url)
1868
1868
        l = dc.open_file("mylink")
1869
 
        l.modify("link bla")
 
1869
        l.modify(b"link bla")
1870
1870
        dc.close()
1871
1871
 
1872
1872
        oldrepos = Repository.open(repos_url)
1889
1889
        repos_url = self.make_svn_repository('d')
1890
1890
 
1891
1891
        dc = self.get_commit_editor(repos_url)
1892
 
        dc.add_file("bla").modify("data")
1893
 
        dc.add_file("mylink").modify("link bla")
 
1892
        dc.add_file("bla").modify(b"data")
 
1893
        dc.add_file("mylink").modify(b"link bla")
1894
1894
        dc.close()
1895
1895
        ra = SvnRaTransport(repos_url)
1896
1896
        dc = self.get_commit_editor(repos_url)
1916
1916
        repos_url = self.make_svn_repository('d')
1917
1917
 
1918
1918
        dc = self.get_commit_editor(repos_url)
1919
 
        dc.add_file("bla").modify("data")
 
1919
        dc.add_file("bla").modify(b"data")
1920
1920
        dc.close()
1921
1921
 
1922
1922
        dc = self.get_commit_editor(repos_url)
1945
1945
 
1946
1946
        dc = self.get_commit_editor(repos_url)
1947
1947
        trunk = dc.add_dir("trunk")
1948
 
        trunk.add_file("trunk/bla").modify("data")
 
1948
        trunk.add_file("trunk/bla").modify(b"data")
1949
1949
        dc.close()
1950
1950
 
1951
1951
        dc = self.get_commit_editor(repos_url)
1978
1978
 
1979
1979
        dc = self.get_commit_editor(repos_url)
1980
1980
        trunk = dc.add_dir("trunk")
1981
 
        trunk.add_file("trunk/bla").modify("data")
 
1981
        trunk.add_file("trunk/bla").modify(b"data")
1982
1982
        dc.close()
1983
1983
 
1984
1984
        dc = self.get_commit_editor(repos_url)
1985
1985
        branches = dc.add_dir("branches")
1986
1986
        foo = branches.add_dir("branches/foo", "trunk")
1987
 
        foo.open_file("branches/foo/bla").modify("more data")
 
1987
        foo.open_file("branches/foo/bla").modify(b"more data")
1988
1988
        dc.close()
1989
1989
 
1990
1990
        oldrepos = Repository.open(repos_url)
2070
2070
        repos_url = self.make_svn_repository('d')
2071
2071
        dc = self.get_commit_editor(repos_url)
2072
2072
        trunk = dc.add_dir("trunk")
2073
 
        trunk.add_file("trunk/bla").modify("data")
 
2073
        trunk.add_file("trunk/bla").modify(b"data")
2074
2074
        dc.close()
2075
2075
 
2076
2076
        dc = self.get_commit_editor(repos_url)
2103
2103
        repos_url = self.make_svn_repository('d')
2104
2104
        dc = self.get_commit_editor(repos_url)
2105
2105
        trunk = dc.add_dir("trunk")
2106
 
        trunk.add_file("trunk/bla").modify("data")
 
2106
        trunk.add_file("trunk/bla").modify(b"data")
2107
2107
        dc.close()
2108
2108
 
2109
2109
        dc = self.get_commit_editor(repos_url)
2214
2214
        dc = self.get_commit_editor(repos_url)
2215
2215
        trunk = dc.add_dir("trunk")
2216
2216
        adir = trunk.add_dir("trunk/adir")
2217
 
        adir.add_file("trunk/adir/afile").modify("data")
 
2217
        adir.add_file("trunk/adir/afile").modify(b"data")
2218
2218
        adir.add_dir("trunk/adir/stationary")
2219
2219
        dc.add_dir("branches").add_dir("branches/abranch")
2220
2220
        dc.close()
2228
2228
        # prevrev
2229
2229
        dc = self.get_commit_editor(repos_url)
2230
2230
        bdir = dc.open_dir("branches").open_dir("branches/abranch").open_dir("branches/abranch/bdir")
2231
 
        bdir.open_file("branches/abranch/bdir/afile").modify("otherdata")
 
2231
        bdir.open_file("branches/abranch/bdir/afile").modify(b"otherdata")
2232
2232
        dc.close()
2233
2233
 
2234
2234
        # lastrev
2235
2235
        dc = self.get_commit_editor(repos_url)
2236
2236
        bdir = dc.open_dir("branches").open_dir("branches/abranch").open_dir("branches/abranch/bdir")
2237
 
        bdir.add_file("branches/abranch/bdir/bfile").modify("camel")
 
2237
        bdir.add_file("branches/abranch/bdir/bfile").modify(b"camel")
2238
2238
        stationary = bdir.open_dir("/branches/abranch/bdir/stationary")
2239
 
        stationary.add_file("branches/abranch/bdir/stationary/traveller").modify("data")
 
2239
        stationary.add_file("branches/abranch/bdir/stationary/traveller").modify(b"data")
2240
2240
        dc.close()
2241
2241
 
2242
2242
        oldrepos = Repository.open(repos_url)