mirror of https://github.com/python/cpython.git
Small cleanup
This commit is contained in:
parent
ad548b8534
commit
56ec5fe950
|
@ -39,18 +39,13 @@ def call_fxn(*args, **kwargs):
|
||||||
@status("Getting the list of files that have been added/changed",
|
@status("Getting the list of files that have been added/changed",
|
||||||
info=lambda x: n_files_str(len(x)))
|
info=lambda x: n_files_str(len(x)))
|
||||||
def changed_files():
|
def changed_files():
|
||||||
"""Get the list of changed or added files from the VCS."""
|
"""Get the list of changed or added files from Mercurial."""
|
||||||
if os.path.isdir(os.path.join(SRCDIR, '.hg')):
|
if not os.path.isdir(os.path.join(SRCDIR, '.hg')):
|
||||||
cmd = 'hg status --added --modified --no-status'
|
|
||||||
else:
|
|
||||||
sys.exit('need a checkout to get modified files')
|
sys.exit('need a checkout to get modified files')
|
||||||
|
|
||||||
st = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
|
cmd = 'hg status --added --modified --no-status'
|
||||||
try:
|
with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st:
|
||||||
st.wait()
|
|
||||||
return [x.decode().rstrip() for x in st.stdout]
|
return [x.decode().rstrip() for x in st.stdout]
|
||||||
finally:
|
|
||||||
st.stdout.close()
|
|
||||||
|
|
||||||
|
|
||||||
def report_modified_files(file_paths):
|
def report_modified_files(file_paths):
|
||||||
|
|
Loading…
Reference in New Issue