File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,18 +39,13 @@ def call_fxn(*args, **kwargs):
3939@status ("Getting the list of files that have been added/changed" ,
4040 info = lambda x : n_files_str (len (x )))
4141def changed_files ():
42- """Get the list of changed or added files from the VCS."""
43- if os .path .isdir (os .path .join (SRCDIR , '.hg' )):
44- cmd = 'hg status --added --modified --no-status'
45- else :
42+ """Get the list of changed or added files from Mercurial."""
43+ if not os .path .isdir (os .path .join (SRCDIR , '.hg' )):
4644 sys .exit ('need a checkout to get modified files' )
4745
48- st = subprocess .Popen (cmd .split (), stdout = subprocess .PIPE )
49- try :
50- st .wait ()
46+ cmd = 'hg status --added --modified --no-status'
47+ with subprocess .Popen (cmd .split (), stdout = subprocess .PIPE ) as st :
5148 return [x .decode ().rstrip () for x in st .stdout ]
52- finally :
53- st .stdout .close ()
5449
5550
5651def report_modified_files (file_paths ):
You can’t perform that action at this time.
0 commit comments