Kiln » largefiles » largefiles-truncated
Clone URL:  

Added test script for hg purge.

Changeset 6ee03544091f

Parent 679381247dc8

by David Golub

Changes to 2 files · Browse files at 6ee03544091f Showing diff from parent 679381247dc8 Diff from another changeset...

Change 1 of 1 Show Entire File tests/​test-purge.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@@ -0,0 +1,37 @@
+#!/usr/bin/env python + +# Test hg purge + +import os +import common + +hgt = common.BfilesTester() + +hgt.updaterc({'extensions': [('purge', '')]}) +hgt.announce('setup') +os.mkdir('repo1') +os.chdir('repo1') +hgt.hg(['init']) +hgt.writefile('b1', 'b1') +hgt.writefile('n1', 'n1') +hgt.writefile('n2', 'n2') +hgt.hg(['add', '--bf', 'b1']) +hgt.hg(['add', 'n1']) +hgt.hg(['commit', '-m', 'add some files']) +hgt.hg(['purge']) +hgt.asserttrue(os.path.exists('b1'), 'missing b1') +hgt.asserttrue(hgt.readfile('b1') == 'b1', 'wrong file contents') +hgt.writefile('b2', 'b2') +hgt.hg(['purge']) +hgt.assertfalse(os.path.exists('b2'), 'failed to purge b2') +hgt.writefile('b2', 'b2') +hgt.hg(['add', '--bf', 'b2']) +hgt.hg(['purge']) +hgt.asserttrue(os.path.exists('b2'), 'missing b2') +hgt.asserttrue(hgt.readfile('b2') == 'b2', 'wrong file contents') +hgt.hg(['commit', '-m', 'add another bfile']) +hgt.writefile('b2', 'b22') +hgt.hg(['purge']) +hgt.asserttrue(os.path.exists('b2'), 'missing b2') +hgt.asserttrue(hgt.readfile('b2') == 'b22', 'wrong file contents') +os.chdir('..')
Change 1 of 1 Show Entire File tests/​test-purge.py.out Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
@@ -0,0 +1,11 @@
+% setup +hg init +hg add --bf b1 +hg add n1 +hg commit -m 'add some files' +hg purge +hg purge +hg add --bf b2 +hg purge +hg commit -m 'add another bfile' +hg purge