def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("file_in_root.txt", "\n".join(["apple", " banana", "cat"])) repo.write_file("d1/d2/afile.txt", "\n".join(["banana", " banana"])) repo.write_file("d1/d2/bfile.txt", "\n".join([" banana", "cat", "dog"])) repo.commit("Initial commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("hello", "hola\n") self.commit1 = repo.commit("Initial commit.") repo.write_file("hello", "goodbye\n") repo.write_file("subdir/file2", "another file\n") self.commit2 = repo.commit("Commit 2")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: # Create a couple commits in flatmanifest mode repo.write_file('src/main.sh', 'echo hello world\n') repo.write_file('src/test/test.sh', 'echo success\n') repo.write_file('src/.gitignore', '*.o\n') repo.write_file('doc/readme.txt', 'sample repository\n') repo.write_file('.gitignore', 'ignoreme\n') self.commit1 = repo.commit('Initial commit.') repo.write_file('src/.gitignore', '*.[oa]\n') self.commit2 = repo.commit('Update src/.gitignore') # Now enable treemanifest # Note that we don't set paths.default or remotefilelog.fallbackpath # here, so treemanifest prefetching will always fail since it does not # have a remote repository to fetch from. hgrc = get_default_hgrc() hgrc['extensions']['fastmanifest'] = '' hgrc['extensions']['treemanifest'] = '' hgrc['fastmanifest'] = { 'usetree': 'True', 'usecache': 'False', } hgrc['remotefilelog'] = { 'reponame': 'eden_integration_tests', 'cachepath': os.path.join(self.tmp_dir, 'hgcache'), } repo.write_hgrc(hgrc) # Create a couple new commits now that treemanifest is enabled repo.write_file('src/test/test2.sh', 'echo success2\n') self.commit3 = repo.commit('Add test2') repo.write_file('src/test/test2.sh', 'echo success\necho success\n') self.commit4 = repo.commit('Update test2')
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("letters", "a\nb\nc\n") repo.write_file("numbers", "1\n2\n3\n") repo.commit("First commit.") repo.write_file("numbers", "4\n5\n6\n") repo.commit("Second commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: # Create a couple commits in flatmanifest mode repo.write_file("src/main.sh", "echo hello world\n") repo.write_file("src/test/test.sh", "echo success\n") repo.write_file("src/.gitignore", "*.o\n") repo.write_file("doc/readme.txt", "sample repository\n") repo.write_file(".gitignore", "ignoreme\n") self.commit1 = repo.commit("Initial commit.") repo.write_file("src/.gitignore", "*.[oa]\n") self.commit2 = repo.commit("Update src/.gitignore") # Now enable treemanifest # Note that we don't set paths.default or remotefilelog.fallbackpath # here, so treemanifest prefetching will always fail since it does not # have a remote repository to fetch from. hgrc = get_default_hgrc() hgrc["extensions"]["fastmanifest"] = "" hgrc["extensions"]["treemanifest"] = "" hgrc["fastmanifest"] = {"usetree": "True", "usecache": "False"} hgrc["remotefilelog"] = { "reponame": "eden_integration_tests", "cachepath": os.path.join(self.tmp_dir, "hgcache"), } repo.write_hgrc(hgrc) # Create a couple new commits now that treemanifest is enabled repo.write_file("src/test/test2.sh", "echo success2\n") self.commit3 = repo.commit("Add test2") repo.write_file("src/test/test2.sh", "echo success\necho success\n") self.commit4 = repo.commit("Update test2")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("letters", "a\nb\nc\n") repo.write_file("numbers", "1\n2\n3\n") self.commit1 = repo.commit("Initial commit.") repo.write_file("letters", "a\n") repo.write_file("numbers", "1\n") self.commit2 = repo.commit("New commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("first", "") self._commit1 = repo.commit("first commit") repo.write_file("second", "") self._commit2 = repo.commit("second commit") repo.write_file("third", "") self._commit3 = repo.commit("third commit")
def populate_backing_repo(self, repo: HgRepository) -> None: repo.write_file("foo", "original") self.commit0 = repo.commit("root commit") repo.write_file("foo", "1") self.commit1 = repo.commit("commit1") repo.update(self.commit0) repo.write_file("foo", "2") self.commit2 = repo.commit("commit2")
def populate_backing_repo(self, repo: HgRepository) -> None: repo.write_file('foo', 'original') self.commit0 = repo.commit('root commit') repo.write_file('foo', '1') self.commit1 = repo.commit('commit1') repo.update(self.commit0) repo.write_file('foo', '2') self.commit2 = repo.commit('commit2')
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("src/main.c", "hello world\n") repo.write_file("src/hello.c", "hello2\n") repo.write_file("src/test/test.c", "test\n") repo.write_file("src/foo/bar.txt", "bar") self.commit1 = repo.commit("Initial commit.") repo.hg("rm", "src/test/test.c") self.commit2 = repo.commit("Remove src/hello.c") repo.hg("rm", "src/hello.c") self.commit3 = repo.commit("Remove src/hello.c")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file('src/main.c', 'hello world\n') repo.write_file('src/hello.c', 'hello2\n') repo.write_file('src/test/test.c', 'test\n') repo.write_file('src/foo/bar.txt', 'bar') self.commit1 = repo.commit('Initial commit.') repo.hg('rm', 'src/test/test.c') self.commit2 = repo.commit('Remove src/hello.c') repo.hg('rm', 'src/hello.c') self.commit3 = repo.commit('Remove src/hello.c')
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("README.md", "docs\n") repo.write_file("LICENSE", "legal legal\n") repo.write_file("src/main.cpp", "code\n") repo.write_file("src/lib.cpp", "more code\n") repo.write_file("src/stuff.cpp", "more code\n") repo.write_file("src/util.py", "utils\n") repo.write_file("src/lib/module.cpp", "module\n") repo.write_file("src/lib/foo.cpp", "foo\n") repo.write_file("src/include/stuff.h", "header\n") repo.write_file("test/test1.py", "test\n") repo.write_file("test/test2.py", "test\n") repo.commit("Initial commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file('hello.txt', 'hola') repo.write_file('.gitignore', 'ignoreme\n') repo.write_file('foo/.gitignore', '*.log\n') repo.write_file('foo/bar.txt', 'test\n') repo.write_file('foo/subdir/test.txt', 'test\n') self.commit1 = repo.commit('Initial commit.') repo.write_file('foo/.gitignore', '*.log\n/_*\n') self.commit2 = repo.commit('Update foo/.gitignore') repo.write_file('foo/bar.txt', 'updated in commit 3\n') self.commit3 = repo.commit('Update foo/.gitignore')
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("hello.txt", "hola") repo.write_file(".gitignore", "ignoreme\n") repo.write_file("foo/.gitignore", "*.log\n") repo.write_file("foo/bar.txt", "test\n") repo.write_file("foo/subdir/test.txt", "test\n") self.commit1 = repo.commit("Initial commit.") repo.write_file("foo/.gitignore", "*.log\n/_*\n") self.commit2 = repo.commit("Update foo/.gitignore") repo.write_file("foo/bar.txt", "updated in commit 3\n") self.commit3 = repo.commit("Update foo/.gitignore")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("dir/file1", "one") repo.write_file("dir/file2", "two") self.commit1 = repo.commit("Initial commit.") repo.remove_file("dir/file1") self.commit2 = repo.commit("Remove file1") repo.write_file("dir/file3", "three") self.commit3 = repo.commit("Add file3") repo.update(self.commit1) repo.write_file("dir/file2", "new two") self.commit4 = repo.commit("Change file2")
def populate_backing_repo(self, repo: HgRepository) -> None: repo.write_file("dir1/a.txt", "original contents of a\n") repo.write_file("dir1/b.txt", "b.txt\n") repo.write_file("dir1/c.txt", "c.txt\n") repo.write_file("dir2/x.txt", "x.txt\n") repo.write_file("dir2/y.txt", "y.txt\n") self.commit1 = repo.commit("Initial commit.") repo.write_file("dir1/a.txt", "updated contents of a\n", add=False) self.commit2 = repo.commit("commit 2") repo.write_file("dir1/b.txt", "updated b\n", add=False) self.commit3 = repo.commit("commit 3") repo.write_file("dir1/a.txt", "original contents of a\n") self.commit4 = repo.commit("commit 4")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("dir/file1", "one") repo.write_file("dir/file2", "two") self.commit1 = repo.commit("Initial commit.") repo.remove_file("dir/file1") # pyre-fixme[16]: `UpdateCacheInvalidationTest` has no attribute `commit2`. self.commit2 = repo.commit("Remove file1") repo.write_file("dir/file3", "three") # pyre-fixme[16]: `UpdateCacheInvalidationTest` has no attribute `commit3`. self.commit3 = repo.commit("Add file3") repo.update(self.commit1) repo.write_file("dir/file2", "new two") # pyre-fixme[16]: `UpdateCacheInvalidationTest` has no attribute `commit4`. self.commit4 = repo.commit("Change file2")
def populate_backing_repo(self, repo: HgRepository) -> None: logging.debug('== populate_backing_repo') # By default repo.write_file() also calls "hg add" on the path. # Unfortunately "hg add" is really slow. Disable calling it one at a # time on these files as we write them. We'll make a single "hg add" # call at the end with all paths in a single command. new_files = [] self.fanouts = [4, 4, 4, 4] def populate_dir(path: str) -> None: logging.debug('populate %s', path) test_path = os.path.join(path, 'test.txt') repo.write_file(test_path, f'test\n{path}\n', add=False) new_files.append(test_path) gitignore_path = os.path.join(path, '.gitignore') gitignore_contents = f'*.log\n/{path}/foo.txt\n' repo.write_file(gitignore_path, gitignore_contents, add=False) new_files.append(gitignore_path) self._fanout('src', self.fanouts, populate_dir, populate_dir) self._hg_add_many(repo, new_files) self.commit1 = repo.commit('Initial commit.') logging.debug('== created initial commit') new_files = [] self.expected_status: Dict[str, str] = {} def create_new_file(path: str) -> None: logging.debug('add new file in %s', path) new_path = os.path.join(path, 'new.txt') repo.write_file(new_path, 'new\n', add=False) new_files.append(new_path) self.expected_status[new_path] = '?' self._fanout('src', self.fanouts, create_new_file) self._hg_add_many(repo, new_files) self.commit2 = repo.commit('Initial commit.') logging.debug('== created second commit')
def populate_backing_repo(self, repo: HgRepository) -> None: logging.debug("== populate_backing_repo") # By default repo.write_file() also calls "hg add" on the path. # Unfortunately "hg add" is really slow. Disable calling it one at a # time on these files as we write them. We'll make a single "hg add" # call at the end with all paths in a single command. new_files = [] fanouts = [4, 4, 4, 4] def populate_dir(path: str) -> None: logging.debug("populate %s", path) test_path = os.path.join(path, "test.txt") repo.write_file(test_path, f"test\n{path}\n", add=False) new_files.append(test_path) gitignore_path = os.path.join(path, ".gitignore") gitignore_contents = f"*.log\n/{path}/foo.txt\n" repo.write_file(gitignore_path, gitignore_contents, add=False) new_files.append(gitignore_path) gen_tree("src", fanouts, populate_dir, populate_dir) self._hg_add_many(repo, new_files) self.commit1 = repo.commit("Initial commit.") logging.debug("== created initial commit") new_files = [] def create_new_file(path: str) -> None: logging.debug("add new file in %s", path) new_path = os.path.join(path, "new.txt") repo.write_file(new_path, "new\n", add=False) new_files.append(new_path) self.expected_status[new_path] = "?" gen_tree("src", fanouts, create_new_file) self._hg_add_many(repo, new_files) # pyre-fixme[16]: `StatusDeadlockTest` has no attribute `commit2`. self.commit2 = repo.commit("Initial commit.") logging.debug("== created second commit")
def populate_backing_repo(self, repo: HgRepository) -> None: logging.debug("== populate_backing_repo") # By default repo.write_file() also calls "hg add" on the path. # Unfortunately "hg add" is really slow. Disable calling it one at a # time on these files as we write them. We'll make a single "hg add" # call at the end with all paths in a single command. new_files = [] fanouts = [4, 4, 4, 4] def populate_dir(path: str) -> None: logging.debug("populate %s", path) test_path = os.path.join(path, "test.txt") repo.write_file(test_path, f"test\n{path}\n", add=False) new_files.append(test_path) gitignore_path = os.path.join(path, ".gitignore") gitignore_contents = f"*.log\n/{path}/foo.txt\n" repo.write_file(gitignore_path, gitignore_contents, add=False) new_files.append(gitignore_path) gen_tree("src", fanouts, populate_dir, populate_dir) self._hg_add_many(repo, new_files) self.commit1 = repo.commit("Initial commit.") logging.debug("== created initial commit") new_files = [] def create_new_file(path: str) -> None: logging.debug("add new file in %s", path) new_path = os.path.join(path, "new.txt") repo.write_file(new_path, "new\n", add=False) new_files.append(new_path) self.expected_status[new_path] = "?" gen_tree("src", fanouts, create_new_file) self._hg_add_many(repo, new_files) self.commit2 = repo.commit("Initial commit.") logging.debug("== created second commit")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("readme.txt", "readme\n") repo.write_file( "src/test.c", """\ start of the file line 1 line 2 line 3 end of the file """, ) self.commit1 = repo.commit("Initial commit.") repo.hg("phase", "--public", self.commit1) log.debug("commit1: %s", self.commit1)
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("hello.txt", "hola") repo.commit("Initial commit.\n")
def make_dummy_hg_repo(self) -> HgRepository: repo = HgRepository(path=self.make_temporary_directory()) repo.init() repo.write_file("hello", "") repo.commit("Initial commit.") return repo
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("hello", "hello") self.commit1 = repo.commit("Initial commit.\n") repo.write_file("hello", "hola") self.commit2 = repo.commit("Second commit.\n")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file('hello.txt', 'hola') repo.write_file('foo/bar.txt', 'test\n') repo.write_file('foo/subdir/test.txt', 'test\n') self.commit1 = repo.commit('Initial commit.\n')
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("src/common/foo/test.txt", "testing\n") self.commit1 = repo.commit("Initial commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("contents1", "c1\n") repo.write_file("contents2", "c2\n") repo.symlink("symlink", "contents1") repo.commit("Initial commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("rootfile.txt", "") repo.write_file("dir1/a.txt", "original contents\n") repo.commit("Initial commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("rootfile.txt", "") repo.write_file("dir1/a.txt", "original contents") repo.commit("Initial commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("first.txt", "1") self.commit1 = repo.commit("Initial commit\n")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("hello", "bonjour\n") self.commit0 = repo.commit("Commit 0.") repo.write_file("hola", "hello\n") self.commit1 = repo.commit("Commit 1.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.mkdir("numbers") repo.write_file("numbers/README", "this will have two directories") self._base_commit = repo.commit("commit") repo.mkdir("numbers/1") repo.write_file("numbers/1/11", "11\n") self._c11 = repo.commit("c11") repo.write_file("numbers/1/12", "12\n") self._c12 = repo.commit("c12") repo.write_file("numbers/1/13", "13\n") self._c13 = repo.commit("c13") repo.write_file("numbers/1/14", "14\n") self._c14 = repo.commit("c14") repo.write_file("numbers/1/15", "15\n") self._c15 = repo.commit("c15") repo.update(self._base_commit) repo.mkdir("numbers/2") repo.write_file("numbers/2/21", "21\n") self._c21 = repo.commit("c21") repo.write_file("numbers/2/22", "22\n") self._c22 = repo.commit("c22") repo.write_file("numbers/2/23", "23\n") self._c23 = repo.commit("c23") repo.write_file("numbers/2/24", "24\n") self._c24 = repo.commit("c24") repo.write_file("numbers/2/25", "25\n") self._c25 = repo.commit("c25") repo.update(self._base_commit)
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("hello", "hola\n") repo.write_file("dir/file", "blah\n") repo.commit("Initial commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("apple", "") repo.write_file("banana", "") repo.commit("first commit")
def populate_backing_repo(self, repo: HgRepository) -> None: repo.write_file("hello.txt", "hola") repo.write_file("subdir/file.txt", "contents") repo.commit("Initial commit.")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("hello.txt", "hola") repo.write_file("foo/bar.txt", "test\n") repo.write_file("foo/subdir/test.txt", "test\n") self.commit1 = repo.commit("Initial commit.\n")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("a_file.txt", "") repo.commit("first commit")
def populate_backing_repo(self, repo: hgrepo.HgRepository) -> None: repo.write_file("letters", "a\nb\nc\n") repo.write_file("numbers", "1\n2\n3\n") repo.commit("Initial commit.")