def find_scm_root(target, scm): scm_dir = find_file_bottom_up('.' + scm, target) if not scm_dir: return '' return os.path.dirname(scm_dir)