def test_no_upgrade_single_file(self): """There's one basis revision per tree. Since you can't actually change the basis for a single file at the moment, we don't let you think you can. See bug 557886. """ self.make_branch_and_tree('.') self.build_tree_contents([('a/', ), ('a/file', 'content')]) sr = ScriptRunner() sr.run_script( self, ''' $ bzr update ./a 2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory $ bzr update ./a/file 2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory $ bzr update . 2>Tree is up to date at revision 0 of branch ... $ cd a $ bzr update . 2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory # however, you can update the whole tree from a subdirectory $ bzr update 2>Tree is up to date at revision 0 of branch ... ''')
def test_no_upgrade_single_file(self): """There's one basis revision per tree. Since you can't actually change the basis for a single file at the moment, we don't let you think you can. See bug 557886. """ self.make_branch_and_tree('.') self.build_tree_contents([('a/',), ('a/file', 'content')]) sr = ScriptRunner() sr.run_script(self, ''' $ bzr update ./a 2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory $ bzr update ./a/file 2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory $ bzr update . 2>Tree is up to date at revision 0 of branch ... $ cd a $ bzr update . 2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory # however, you can update the whole tree from a subdirectory $ bzr update 2>Tree is up to date at revision 0 of branch ... ''')
def test_unshelve_keep(self): # https://bugs.launchpad.net/bzr/+bug/492091 tree = self.make_branch_and_tree('.') # shelve apparently unhappy working with a tree with no root yet tree.commit('make root') self.build_tree(['file']) sr = ScriptRunner() sr.run_script(self, ''' $ bzr add file adding file $ bzr shelve --all -m Foo 2>Selected changes: 2>-D file 2>Changes shelved with id "1". $ bzr shelve --list 1: Foo $ bzr unshelve --keep 2>Using changes with id "1". 2>Message: Foo 2>+N file 2>All changes applied successfully. $ bzr shelve --list 1: Foo $ cat file contents of file ''')
def test_update_up_to_date_checkout(self): self.make_branch_and_tree('branch') self.run_bzr('checkout branch checkout') sr = ScriptRunner() sr.run_script(self, ''' $ bzr update checkout 2>Tree is up to date at revision 0 of branch .../branch ''')
def test_update_up_to_date_checkout(self): self.make_branch_and_tree('branch') self.run_bzr('checkout branch checkout') sr = ScriptRunner() sr.run_script( self, ''' $ bzr update checkout 2>Tree is up to date at revision 0 of branch .../branch ''')
def test_uncommit_shows_log_with_revision_id(self): wt = self.create_simple_tree() script = ScriptRunner() script.run_script(self, """ $ cd tree $ bzr uncommit --force 2 ... second commit ... The above revision(s) will be removed. You can restore the old tip by running: bzr pull . -r revid:a2 """)
def test_uncommit_shows_log_with_revision_id(self): wt = self.create_simple_tree() script = ScriptRunner() script.run_script( self, """ $ cd tree $ bzr uncommit --force 2 ... second commit ... The above revision(s) will be removed. You can restore the old tip by running: bzr pull . -r revid:a2 """)
def test_update_dash_r(self): master = self.make_branch_and_tree('master') os.chdir('master') self.build_tree(['./file1']) master.add(['file1']) master.commit('one', rev_id='m1') self.build_tree(['./file2']) master.add(['file2']) master.commit('two', rev_id='m2') sr = ScriptRunner() sr.run_script(self, ''' $ bzr update -r 1 2>-D file2 2>All changes applied successfully. 2>Updated to revision 1 of .../master ''') self.assertPathExists('./file1') self.assertPathDoesNotExist('./file2') self.assertEquals(['m1'], master.get_parent_ids())
def test_update_dash_r(self): master = self.make_branch_and_tree('master') os.chdir('master') self.build_tree(['./file1']) master.add(['file1']) master.commit('one', rev_id='m1') self.build_tree(['./file2']) master.add(['file2']) master.commit('two', rev_id='m2') sr = ScriptRunner() sr.run_script( self, ''' $ bzr update -r 1 2>-D file2 2>All changes applied successfully. 2>Updated to revision 1 of .../master ''') self.assertPathExists('./file1') self.assertPathDoesNotExist('./file2') self.assertEqual(['m1'], master.get_parent_ids())
def test_update_dash_r_in_master(self): # Test that 'bzr update' works correctly when you have # an update in the master tree, master = self.make_branch_and_tree('master') self.build_tree(['master/file1']) master.add(['file1']) master.commit('one', rev_id='m1') self.run_bzr('checkout master checkout') # add a revision in the master. self.build_tree(['master/file2']) master.add(['file2']) master.commit('two', rev_id='m2') os.chdir('checkout') sr = ScriptRunner() sr.run_script(self, ''' $ bzr update -r revid:m2 2>+N file2 2>All changes applied successfully. 2>Updated to revision 2 of branch .../master ''')
def test_update_dash_r_in_master(self): # Test that 'bzr update' works correctly when you have # an update in the master tree, master = self.make_branch_and_tree('master') self.build_tree(['master/file1']) master.add(['file1']) master.commit('one', rev_id='m1') self.run_bzr('checkout master checkout') # add a revision in the master. self.build_tree(['master/file2']) master.add(['file2']) master.commit('two', rev_id='m2') os.chdir('checkout') sr = ScriptRunner() sr.run_script( self, ''' $ bzr update -r revid:m2 2>+N file2 2>All changes applied successfully. 2>Updated to revision 2 of branch .../master ''')