Kiln » Kiln Extensions
Clone URL:  
test-kilnnobfiles.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python # # Test basic kiln interaction import os import common import time import kilntest hgt = common.BfilesTester() hgt.updaterc({'extensions': [('kilnauth', kilntest.KILNAUTHPATH)]}) hgt.announce('setup') token = kilntest.gettoken() kilntest.deletetest(hgt, token) test = kilntest.createtest(hgt, token) # Don't log this because command depends on path to kiln which can change hgt.hg(['clone', test[0], 'repo1'], stdout='''no changes found updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved ''', log=False) os.chdir('repo1') os.mkdir('a') os.mkdir('a/b') os.mkdir('a/b/c') os.chdir('a') hgt.writefile('n1', 'n1') hgt.writefile('b/n2', 'n2') hgt.writefile('b/c/n3', 'n3') hgt.writefile('../n4', 'n4') hgt.writefile('b1', 'b1') hgt.writefile('b/b2', 'b2') hgt.writefile('b/c/b3', 'b3') hgt.writefile('../b4', 'b4') hgt.hg(['add', 'n1', 'b/n2', 'b/c/n3', '../n4']) hgt.hg(['add', '--bf'], stdout='''adding b/b2 as bfile adding b/c/b3 as bfile adding b1 as bfile adding ../b4 as bfile ''') hgt.hg(['commit', '-m', 'add files']) hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test searching for changes searching for changes remote: kiln: successfully pushed one changeset ''' % kilntest.KILNURL) # edit to time so that server doesn't have it cached contents = str(time.clock()) hgt.writefile('n1', contents) hgt.writefile('b1', contents ) hgt.hg(['commit', '-m', 'edit n1 and b1']) # turn bfiles off for testing hgt.announce('test with no bfiles') hgt.updaterc({'extensions': [('kbfiles', '!')]}) os.chdir('../..') hgt.hg(['clone', test[0], 'repo2'], stdout='requesting all changes\n', log=False, stderr='abort: HTTP Error 400: To access this repository, install the kiln-bfiles extension from %s/Tools\n' % kilntest.KILNURL, status=255) os.chdir('repo1') hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test searching for changes remote: ERROR: Big file a/b1 at revision 1 has not been uploaded to the kiln server. remote: ERROR: All big files must be uploaded to the kiln server before the repository is changed. remote: transaction abort! remote: rollback completed remote: abort: pretxnchangegroup hook failed ''' % kilntest.KILNURL, status=1)