def find_files_with_cmd(dirname='.'):
 try:
  proc = subprocess.Popen(['hg', 'locate', '-I', os.path.abspath(dirname)], stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE, cwd=dirname)
  (stdout, stderr) = proc.communicate()
 except:
  return []
 return stdout.splitlines()

def find_files_with_cmd ( dirname = '.' ) : try : proc = subprocess . Popen ( [ 'hg' , 'locate' , '-I' , os . path . abspath ( dirname ) ] , stdin = subprocess . PIPE , stderr = subprocess . PIPE , stdout = subprocess . PIPE , cwd = dirname ) ( stdout , stderr ) = proc . communicate ( ) except : return [ ] return stdout . splitlines ( )
use the hg command to recursively find versioned files in dirname .