def setUp(self): AbstractSCMTest.setUp(self) remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) # create a "remote" repo subprocess.check_call(["bzr", "init"], cwd=remote_path) subprocess.check_call(["touch", "test.txt"], cwd=remote_path) subprocess.check_call(["bzr", "add", "test.txt"], cwd=remote_path) subprocess.check_call(["bzr", "commit", "-m", "modified"], cwd=remote_path) self.version_init = "1" subprocess.check_call(["bzr", "tag", "footag"], cwd=remote_path) subprocess.check_call(["touch", "test2.txt"], cwd=remote_path) subprocess.check_call(["bzr", "add", "test2.txt"], cwd=remote_path) subprocess.check_call(["bzr", "commit", "-m", "modified"], cwd=remote_path) self.version_end = "2" # rosinstall the remote repo and fake ros _add_to_file(os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- bzr: {local-name: clone, uri: ../remote}") cmd = ["rosws", "update"] os.chdir(self.local_path) sys.stdout = output = StringIO() rosws_main(cmd) output = output.getvalue() sys.stdout = sys.__stdout__
def setUp(self): AbstractSCMTest.setUp(self) remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) # create a "remote" repo subprocess.check_call(["hg", "init"], cwd=remote_path) subprocess.check_call(["touch", "test.txt"], cwd=remote_path) subprocess.check_call(["hg", "add", "test.txt"], cwd=remote_path) subprocess.check_call(["hg", "commit", "-m", "modified"], cwd=remote_path) po = subprocess.Popen(["hg", "log", "--template", "'{node|short}'", "-l1"], cwd=remote_path, stdout=subprocess.PIPE) self.version_init = po.stdout.read().decode('UTF-8').rstrip("'").lstrip("'") subprocess.check_call(["hg", "tag", "footag"], cwd=remote_path) subprocess.check_call(["touch", "test2.txt"], cwd=remote_path) subprocess.check_call(["hg", "add", "test2.txt"], cwd=remote_path) subprocess.check_call(["hg", "commit", "-m", "modified"], cwd=remote_path) po = subprocess.Popen(["hg", "log", "--template", "'{node|short}'", "-l1"], cwd=remote_path, stdout=subprocess.PIPE) self.version_end = po.stdout.read().decode('UTF-8').rstrip("'").lstrip("'") # rosinstall the remote repo and fake ros _add_to_file(os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- hg: {local-name: clone, uri: ../remote}") cmd = ["rosws", "update"] os.chdir(self.local_path) sys.stdout = output = StringIO() rosws_main(cmd) output = output.getvalue() sys.stdout = sys.__stdout__
def setUp(self): AbstractSCMTest.setUp(self) remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) # create a "remote" repo subprocess.check_call(["bzr", "init"], cwd=remote_path) subprocess.check_call(["touch", "test.txt"], cwd=remote_path) subprocess.check_call(["bzr", "add", "test.txt"], cwd=remote_path) subprocess.check_call(["bzr", "commit", "-m", "modified"], cwd=remote_path) self.version_init = "1" subprocess.check_call(["bzr", "tag", "footag"], cwd=remote_path) subprocess.check_call(["touch", "test2.txt"], cwd=remote_path) subprocess.check_call(["bzr", "add", "test2.txt"], cwd=remote_path) subprocess.check_call(["bzr", "commit", "-m", "modified"], cwd=remote_path) self.version_end = "2" # rosinstall the remote repo and fake ros _add_to_file( os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- bzr: {local-name: clone, uri: ../remote}" ) cmd = ["rosws", "update"] os.chdir(self.local_path) sys.stdout = output = StringIO() rosws_main(cmd) output = output.getvalue() sys.stdout = sys.__stdout__
def setUp(self): AbstractSCMTest.setUp(self) remote_path = os.path.join(self.test_root_path, "remote") filler_path = os.path.join(self.test_root_path, "filler") self.svn_uri = "file://localhost" + remote_path # create a "remote" repo subprocess.check_call(["svnadmin", "create", remote_path], cwd=self.test_root_path) subprocess.check_call(["svn", "checkout", self.svn_uri, filler_path], cwd=self.test_root_path) subprocess.check_call(["touch", "test.txt"], cwd=filler_path) subprocess.check_call(["svn", "add", "test.txt"], cwd=filler_path) subprocess.check_call(["svn", "commit", "-m", "modified"], cwd=filler_path) subprocess.check_call(["touch", "test2.txt"], cwd=filler_path) subprocess.check_call(["svn", "add", "test2.txt"], cwd=filler_path) subprocess.check_call(["svn", "commit", "-m", "modified"], cwd=filler_path) self.version_init = "-r1" self.version_end = "-r2" # wstool the remote repo and fake ros _add_to_file(os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- svn: {local-name: clone, uri: '" + self.svn_uri + "'}") cmd = ["wstool", "update"] os.chdir(self.local_path) sys.stdout = output = StringIO() wstool_main(cmd) output = output.getvalue() sys.stdout = sys.__stdout__
def setUpClass(self): AbstractSCMTest.setUpClass() self.remote_path = os.path.join(self.test_root_path, 'remote') self.new_remote_path = os.path.join(self.test_root_path, 'fooo') self.version = 'master' self.branch = 'test_branch' self.date = datetime.date.today().isoformat() os.makedirs(self.remote_path) create_git_repo(self.remote_path) # wstool the remote repo and fake ros entry = '''\ - other: {local-name: ../ros} - git: {local-name: clone, uri: ../remote, version: %s} ''' % self.version _add_to_file(os.path.join(self.local_path, '.rosinstall'), entry) cmd = ['wstool', 'update', '-t', 'ws'] os.chdir(self.test_root_path) wstool_main(cmd) self.clone_path = os.path.join(self.local_path, 'clone') modify_git_repo(self.clone_path) subprocess.check_call(['git', 'checkout', '-b', self.branch], cwd=self.clone_path) subprocess.check_call(['git', 'remote', 'set-url', 'origin', self.new_remote_path], cwd=self.clone_path)
def setUp(self): AbstractSCMTest.setUp(self) remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) # create a "remote" repo subprocess.check_call(["git", "init"], cwd=remote_path) subprocess.check_call(["touch", "test.txt"], cwd=remote_path) subprocess.check_call(["git", "add", "*"], cwd=remote_path) subprocess.check_call(["git", "commit", "-m", "modified"], cwd=remote_path) po = subprocess.Popen(["git", "log", "-n", "1", "--pretty=format:\"%H\""], cwd=remote_path, stdout=subprocess.PIPE) self.version_init = po.stdout.read().decode('UTF-8').rstrip('"').lstrip('"')[0:12] subprocess.check_call(["git", "tag", "footag"], cwd=remote_path) subprocess.check_call(["touch", "test2.txt"], cwd=remote_path) subprocess.check_call(["git", "add", "*"], cwd=remote_path) subprocess.check_call(["git", "commit", "-m", "modified"], cwd=remote_path) po = subprocess.Popen(["git", "log", "-n", "1", "--pretty=format:\"%H\""], cwd=remote_path, stdout=subprocess.PIPE) self.version_end = po.stdout.read().decode('UTF-8').rstrip('"').lstrip('"')[0:12] # wstool the remote repo and fake ros _add_to_file(os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- git: {local-name: clone, uri: ../remote}") cmd = ["wstool", "update"] os.chdir(self.local_path) sys.stdout = output = StringIO() wstool_main(cmd) output = output.getvalue() sys.stdout = sys.__stdout__
def setUpClass(self): AbstractSCMTest.setUpClass() remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) create_git_repo(remote_path) self.rosinstall_filename = os.path.join(self.local_path, "shallow-test.rosinstall") _add_to_file( self.rosinstall_filename, "- git: {local-name: clone, uri: \"file://" + remote_path + "\"}") cmd = [ "wstool", "init", "ws-without-shallow", self.rosinstall_filename ] os.chdir(self.test_root_path) wstool_main(cmd) cmd = [ "wstool", "init", "--shallow", "ws-with-shallow", self.rosinstall_filename ] os.chdir(self.test_root_path) wstool_main(cmd)
def setUpClass(self): AbstractSCMTest.setUpClass() remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) create_hg_repo(remote_path) # rosinstall the remote repo and fake ros _add_to_file(os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- hg: {local-name: clone, uri: ../remote}") cmd = ["rosinstall", "ws", "-n"] os.chdir(self.test_root_path) rosinstall_main(cmd) clone_path = os.path.join(self.local_path, "clone") modify_hg_repo(clone_path)
def setUpClass(self): AbstractSCMTest.setUpClass() remote_path_svn = os.path.join(self.test_root_path, "remote_svn") remote_path_git = os.path.join(self.test_root_path, "remote_git") remote_path_bzr = os.path.join(self.test_root_path, "remote_bzr") remote_path_hg = os.path.join(self.test_root_path, "remote_hg") os.makedirs(remote_path_git) os.makedirs(remote_path_svn) os.makedirs(remote_path_hg) os.makedirs(remote_path_bzr) filler_path = os.path.join(self.test_root_path, "filler") svn_uri = "file://localhost" + remote_path_svn create_svn_repo(self.test_root_path, remote_path_svn, filler_path, svn_uri) create_git_repo(remote_path_git) create_hg_repo(remote_path_hg) create_bzr_repo(remote_path_bzr) # rosinstall the remote repo and fake ros (using git twice to check all overlaps) rosinstall_spec = """- other: {local-name: ../ros} - git: {local-name: clone_git, uri: ../remote_git} - svn: {local-name: clone_svn, uri: '%s'} - hg: {local-name: clone_hg, uri: ../remote_hg} - bzr: {local-name: clone_bzr, uri: ../remote_bzr} - git: {local-name: clone_git2, uri: ../remote_git}""" % svn_uri _add_to_file(os.path.join(self.local_path, ".rosinstall"), rosinstall_spec) cmd = ["rosinstall", "ws", "-n"] os.chdir(self.test_root_path) rosinstall_main(cmd) clone_path_git = os.path.join(self.local_path, "clone_git") clone_path_git2 = os.path.join(self.local_path, "clone_git2") clone_path_svn = os.path.join(self.local_path, "clone_svn") clone_path_hg = os.path.join(self.local_path, "clone_hg") clone_path_bzr = os.path.join(self.local_path, "clone_bzr") modify_git_repo(clone_path_git2) modify_git_repo(clone_path_git) modify_svn_repo(clone_path_svn) modify_hg_repo(clone_path_hg) modify_bzr_repo(clone_path_bzr)
def setUpClass(self): AbstractSCMTest.setUpClass() remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) create_bzr_repo(remote_path) # wstool the remote repo and fake ros _add_to_file(os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- bzr: {local-name: clone, uri: %s}" % remote_path) cmd = ["wstool", "update", "-t", "ws"] os.chdir(self.test_root_path) wstool_main(cmd) clone_path = os.path.join(self.local_path, "clone") modify_bzr_repo(clone_path)
def setUpClass(self): AbstractSCMTest.setUpClass() remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) create_git_repo(remote_path) self.rosinstall_filename = os.path.join(self.local_path, "shallow-test.rosinstall") _add_to_file(self.rosinstall_filename, "- git: {local-name: clone, uri: \"file://" + remote_path + "\"}") cmd = ["wstool", "init", "ws-without-shallow", self.rosinstall_filename] os.chdir(self.test_root_path) wstool_main(cmd) cmd = ["wstool", "init", "--shallow", "ws-with-shallow", self.rosinstall_filename] os.chdir(self.test_root_path) wstool_main(cmd)
def setUpClass(self): AbstractSCMTest.setUpClass() remote_path = os.path.join(self.test_root_path, "remote") filler_path = os.path.join(self.test_root_path, "filler") svn_uri = "file://localhost" + remote_path create_svn_repo(self.test_root_path, remote_path, filler_path, svn_uri) # wstool the remote repo and fake ros _add_to_file(os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- svn: {local-name: clone, uri: '" + svn_uri + "'}") cmd = ["wstool", "update", "-t", "ws"] os.chdir(self.test_root_path) wstool_main(cmd) clone_path = os.path.join(self.local_path, "clone") modify_svn_repo(clone_path)
def setUpClass(self): AbstractSCMTest.setUpClass() remote_path_svn = os.path.join(self.test_root_path, "remote_svn") remote_path_git = os.path.join(self.test_root_path, "remote_git") remote_path_bzr = os.path.join(self.test_root_path, "remote_bzr") remote_path_hg = os.path.join(self.test_root_path, "remote_hg") os.makedirs(remote_path_git) os.makedirs(remote_path_svn) os.makedirs(remote_path_hg) os.makedirs(remote_path_bzr) filler_path = os.path.join(self.test_root_path, "filler") svn_uri = "file://localhost"+remote_path_svn create_svn_repo(self.test_root_path, remote_path_svn, filler_path, svn_uri) create_git_repo(remote_path_git) create_hg_repo(remote_path_hg) create_bzr_repo(remote_path_bzr) # rosinstall the remote repo and fake ros (using git twice to check all overlaps) rosinstall_spec = """- other: {local-name: ../ros} - git: {local-name: clone_git, uri: ../remote_git} - svn: {local-name: clone_svn, uri: '%s'} - hg: {local-name: clone_hg, uri: ../remote_hg} - bzr: {local-name: clone_bzr, uri: ../remote_bzr} - git: {local-name: clone_git2, uri: ../remote_git}""" % svn_uri _add_to_file(os.path.join(self.local_path, ".rosinstall"), rosinstall_spec) cmd = ["rosinstall", "ws", "-n"] os.chdir(self.test_root_path) rosinstall_main(cmd) clone_path_git = os.path.join(self.local_path, "clone_git") clone_path_git2 = os.path.join(self.local_path, "clone_git2") clone_path_svn = os.path.join(self.local_path, "clone_svn") clone_path_hg = os.path.join(self.local_path, "clone_hg") clone_path_bzr = os.path.join(self.local_path, "clone_bzr") modify_git_repo(clone_path_git2) modify_git_repo(clone_path_git) modify_svn_repo(clone_path_svn) modify_hg_repo(clone_path_hg) modify_bzr_repo(clone_path_bzr)
def setUp(self): AbstractSCMTest.setUp(self) self.remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(self.remote_path) # create a "remote" repo subprocess.check_call(["git", "init"], cwd=self.remote_path) subprocess.check_call(["touch", "test.txt"], cwd=self.remote_path) subprocess.check_call(["git", "add", "*"], cwd=self.remote_path) subprocess.check_call(["git", "commit", "-m", "modified"], cwd=self.remote_path) po = subprocess.Popen( ["git", "log", "-n", "1", "--pretty=format:\"%H\""], cwd=self.remote_path, stdout=subprocess.PIPE) self.version_init = po.stdout.read().decode('UTF-8').rstrip( '"').lstrip('"')[0:12] subprocess.check_call(["git", "tag", "footag"], cwd=self.remote_path) subprocess.check_call(["touch", "test2.txt"], cwd=self.remote_path) subprocess.check_call(["git", "add", "*"], cwd=self.remote_path) subprocess.check_call(["git", "commit", "-m", "modified"], cwd=self.remote_path) po = subprocess.Popen( ["git", "log", "-n", "1", "--pretty=format:\"%H\""], cwd=self.remote_path, stdout=subprocess.PIPE) self.version_end = po.stdout.read().decode('UTF-8').rstrip('"').lstrip( '"')[0:12] # wstool the remote repo and fake ros _add_to_file( os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- git: {local-name: clone, uri: ../remote}" ) self.clone_path = os.path.join(self.local_path, "clone") cmd = ["wstool", "update"] os.chdir(self.local_path) sys.stdout = output = StringIO() wstool_main(cmd) output = output.getvalue() sys.stdout = sys.__stdout__
def setUpClass(self): AbstractSCMTest.setUpClass() remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) create_git_repo(remote_path) # rosinstall the remote repo and fake ros _add_to_file( os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- git: {local-name: clone, uri: ../remote}" ) cmd = ["rosinstall", "ws", "-n"] os.chdir(self.test_root_path) rosinstall_main(cmd) clone_path = os.path.join(self.local_path, "clone") modify_git_repo(clone_path)
def setUp(self): AbstractSCMTest.setUp(self) remote_path = os.path.join(self.test_root_path, "remote") os.makedirs(remote_path) # create a "remote" repo subprocess.check_call(["hg", "init"], cwd=remote_path) subprocess.check_call(["touch", "test.txt"], cwd=remote_path) subprocess.check_call(["hg", "add", "test.txt"], cwd=remote_path) subprocess.check_call(["hg", "commit", "-m", "modified"], cwd=remote_path) po = subprocess.Popen( ["hg", "log", "--template", "'{node|short}'", "-l1"], cwd=remote_path, stdout=subprocess.PIPE) self.version_init = po.stdout.read().decode('UTF-8').rstrip( "'").lstrip("'") subprocess.check_call(["hg", "tag", "footag"], cwd=remote_path) subprocess.check_call(["touch", "test2.txt"], cwd=remote_path) subprocess.check_call(["hg", "add", "test2.txt"], cwd=remote_path) subprocess.check_call(["hg", "commit", "-m", "modified"], cwd=remote_path) po = subprocess.Popen( ["hg", "log", "--template", "'{node|short}'", "-l1"], cwd=remote_path, stdout=subprocess.PIPE) self.version_end = po.stdout.read().decode('UTF-8').rstrip("'").lstrip( "'") # wstool the remote repo and fake ros _add_to_file( os.path.join(self.local_path, ".rosinstall"), "- other: {local-name: ../ros}\n- hg: {local-name: clone, uri: ../remote}" ) cmd = ["wstool", "update"] os.chdir(self.local_path) sys.stdout = output = StringIO() wstool_main(cmd) output = output.getvalue() sys.stdout = sys.__stdout__