Kiln » Kiln Extensions
Clone URL:  
test-edit.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
#!/usr/bin/env python # Test that edited bfiles show up as modified import os import common hgt = common.BfilesTester() def rejoin(path): '''convert unix path to local convention''' return os.path.join(*path.split('/')) # add size and patterns for adding as bfiles hgt.updaterc() hgt.announce('setup') os.mkdir('repo1') os.chdir('repo1') hgt.hg(['init', '-q']) hgt.writefile('normal1', 'foo') os.mkdir('sub') hgt.writefile('sub/normal2', 'bar') hgt.hg(['add', '-q', 'normal1', rejoin('sub/normal2')]) hgt.hg(['commit', '-m', 'add normal files']) hgt.announce('add bfiles') hgt.writefile('big1', 'abc') hgt.writefile('sub/big2', 'xyz') hgt.hg(['add', '--bf', 'big1', rejoin('sub/big2')]) hgt.hg(['status'], stdout='A big1\nA sub/big2\n') hgt.hg(['commit', '-m', 'added bfiles']) hgt.announce('edit big1') hgt.writefile('big1', 'abcd') hgt.hg(['status'], stdout='M big1\n') hgt.announce('edit sub/big2') hgt.writefile('sub/big2', 'xyz1') hgt.hg(['status'], stdout='M big1\nM sub/big2\n') hgt.announce('edit big1 back') hgt.writefile('big1', 'abc') hgt.hg(['status'], stdout='M sub/big2\n') hgt.announce('edit sub/big2 back') hgt.writefile('sub/big2', 'xyz') hgt.hg(['status'])