def mq_patches_applied():
 cmd = 'hg qapplied'
 with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) as st:
  (bstdout, _) = st.communicate()
  return ((st.returncode == 0) and bstdout)

def mq_patches_applied ( ) : cmd = 'hg qapplied' with subprocess . Popen ( cmd . split ( ) , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) as st : ( bstdout , _ ) = st . communicate ( ) return ( ( st . returncode == 0 ) and bstdout )
check if there are any applied mq patches .