@@ -43,20 +43,6 @@ def call_fxn(*args, **kwargs):
43
43
return decorated_fxn
44
44
45
45
46
- def mq_patches_applied ():
47
- """Check if there are any applied MQ patches."""
48
- cmd = 'hg qapplied'
49
- st = subprocess .Popen (cmd .split (),
50
- stdout = subprocess .PIPE ,
51
- stderr = subprocess .PIPE )
52
- try :
53
- bstdout , _ = st .communicate ()
54
- return st .returncode == 0 and bstdout
55
- finally :
56
- st .stdout .close ()
57
- st .stderr .close ()
58
-
59
-
60
46
def get_git_branch ():
61
47
"""Get the symbolic name for the current git branch"""
62
48
cmd = "git rev-parse --abbrev-ref HEAD" .split ()
@@ -101,19 +87,8 @@ def get_base_branch():
101
87
@status ("Getting the list of files that have been added/changed" ,
102
88
info = lambda x : n_files_str (len (x )))
103
89
def changed_files (base_branch = None ):
104
- """Get the list of changed or added files from Mercurial or git."""
105
- if os .path .isdir (os .path .join (SRCDIR , '.hg' )):
106
- if base_branch is not None :
107
- sys .exit ('need a git checkout to check PR status' )
108
- cmd = 'hg status --added --modified --no-status'
109
- if mq_patches_applied ():
110
- cmd += ' --rev qparent'
111
- st = subprocess .Popen (cmd .split (), stdout = subprocess .PIPE )
112
- try :
113
- filenames = [x .decode ().rstrip () for x in st .stdout ]
114
- finally :
115
- st .stdout .close ()
116
- elif os .path .exists (os .path .join (SRCDIR , '.git' )):
90
+ """Get the list of changed or added files from git."""
91
+ if os .path .exists (os .path .join (SRCDIR , '.git' )):
117
92
# We just use an existence check here as:
118
93
# directory = normal git checkout/clone
119
94
# file = git worktree directory
@@ -138,7 +113,7 @@ def changed_files(base_branch=None):
138
113
finally :
139
114
st .stdout .close ()
140
115
else :
141
- sys .exit ('need a Mercurial or git checkout to get modified files' )
116
+ sys .exit ('need a git checkout to get modified files' )
142
117
143
118
filenames2 = []
144
119
for filename in filenames :
0 commit comments