def _update_ignorefile(self, repo, path): """ Check if the `.hgignore` file is valid, if not delete the invalid one and recreate it. """ ignorefile = join(path, ".hgignore") if update_ignorefile(ignorefile): # ...and add and commit repo.hg_add(ignorefile) if repo.hg_status(empty=True) != {}: print("Adding the ignored fileset...") repo.hg_commit("[VONK] Added .hgignore.")
def test_020_UpdateIgnoreFile(self): update_ignorefile(LOCAL_FILE) self.assertTrue(is_valid_ignorefile(LOCAL_FILE))