##// END OF EJS Templates
purge.py: fix invocation of statwalk
Alexis S. L. Carvalho -
r4155:4c714ed2 default
parent child Browse files
Show More
@@ -49,9 +49,10 b' def dopurge(ui, repo, dirs=None, act=Tru'
49
49
50 directories = []
50 directories = []
51 files = []
51 files = []
52 for src, f, st in repo.dirstate.statwalk(files=dirs, ignored=True,
52 roots, match, anypats = util.cmdmatcher(repo.root, repo.getcwd(), dirs)
53 directories=True):
53 for src, f, st in repo.dirstate.statwalk(files=roots, match=match,
54 if src == 'd':
54 ignored=True, directories=True):
55 if src == 'd':
55 directories.append(f)
56 directories.append(f)
56 elif src == 'f' and f not in repo.dirstate:
57 elif src == 'f' and f not in repo.dirstate:
57 files.append(f)
58 files.append(f)
@@ -50,6 +50,25 b' hg purge -p'
50 hg purge -v
50 hg purge -v
51 ls
51 ls
52
52
53 echo % delete nested directories from a subdir
54 mkdir -p untracked_directory/nested_directory
55 cd directory
56 hg purge -p
57 hg purge -v
58 cd ..
59 ls
60
61 echo % delete only part of the tree
62 mkdir -p untracked_directory/nested_directory
63 touch directory/untracked_file
64 cd directory
65 hg purge -p ../untracked_directory
66 hg purge -v ../untracked_directory
67 cd ..
68 ls
69 ls directory/untracked_file
70 rm directory/untracked_file
71
53 echo % delete ignored files
72 echo % delete ignored files
54 touch ignored
73 touch ignored
55 hg purge -p
74 hg purge -p
@@ -29,6 +29,19 b' Removing directory untracked_directory/n'
29 Removing directory untracked_directory
29 Removing directory untracked_directory
30 directory
30 directory
31 r1
31 r1
32 % delete nested directories from a subdir
33 untracked_directory/nested_directory
34 Removing directory untracked_directory/nested_directory
35 Removing directory untracked_directory
36 directory
37 r1
38 % delete only part of the tree
39 untracked_directory/nested_directory
40 Removing directory untracked_directory/nested_directory
41 Removing directory untracked_directory
42 directory
43 r1
44 directory/untracked_file
32 % delete ignored files
45 % delete ignored files
33 ignored
46 ignored
34 Removing file ignored
47 Removing file ignored
General Comments 0
You need to be logged in to leave comments. Login now