def test_update_ignores_externals(self): # update() ignores svn:externals. # We test this in a similar way to test_update, by getting two trees, # mutating one and checking its effect on the other tree -- though # here we are hoping for no effect. tree = SubversionWorkingTree(self.svn_branch_url, 'tree') tree.checkout() tree2 = SubversionWorkingTree(self.svn_branch_url, 'tree2') tree2.checkout() client = subvertpy.client.Client() client.propset( 'svn:externals', 'external http://foo.invalid/svn/something', tree.local_path) tree.commit() tree2.update()
def test_update(self): # update() fetches any changes to the branch from the remote branch. # We test this by checking out the same branch twice, making # modifications in one, then updating the other. If the modifications # appear, then update() works. tree = SubversionWorkingTree(self.svn_branch_url, 'tree') tree.checkout() tree2 = SubversionWorkingTree(self.svn_branch_url, 'tree2') tree2.checkout() # Make a change. # XXX: JonathanLange 2008-02-19: "README" is a mystery guest. new_content = 'Comfort ye\n' self.build_tree_contents([('tree/README', new_content)]) tree.commit() tree2.update() readme_path = os.path.join(tree2.local_path, 'README') self.assertFileEqual(new_content, readme_path)
def _getForeignTree(self, target_path): """Return a foreign tree object for `target_path`.""" source_details = self.import_data_store.source_details if source_details.rcstype == 'svn': return SubversionWorkingTree( source_details.url, str(target_path)) elif source_details.rcstype == 'cvs': return CVSWorkingTree( source_details.cvs_root, source_details.cvs_module, target_path) else: raise AssertionError( "unknown RCS type: %r" % source_details.rcstype)
def test_update_ignores_externals(self): # update() ignores svn:externals. # We test this in a similar way to test_update, by getting two trees, # mutating one and checking its effect on the other tree -- though # here we are hoping for no effect. tree = SubversionWorkingTree(self.svn_branch_url, 'tree') tree.checkout() tree2 = SubversionWorkingTree(self.svn_branch_url, 'tree2') tree2.checkout() client = subvertpy.client.Client() client.propset('svn:externals', 'external http://foo.invalid/svn/something', tree.local_path) tree.commit() tree2.update()
def test_checkout(self): # checkout() checks out an up-to-date working tree to the local path. tree = SubversionWorkingTree(self.svn_branch_url, 'tree') tree.checkout() self.assertIsUpToDate(self.svn_branch_url, tree.local_path)
def test_url(self): # The URL of the repository is available as 'remote_url'. tree = SubversionWorkingTree('url', 'path') self.assertEqual(tree.remote_url, 'url')
def test_path(self): # The local path is passed to the constructor is available as # 'local_path'. tree = SubversionWorkingTree('url', 'path') self.assertEqual(tree.local_path, 'path')