~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_uncommit.py

  • Committer: John Arbash Meinel
  • Date: 2008-09-05 02:29:34 UTC
  • mto: (3697.7.4 1.7)
  • mto: This revision was merged to the branch mainline in revision 3748.
  • Revision ID: john@arbash-meinel.com-20080905022934-s8692mbwpkdwi106
Cleanups to the algorithm documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Test the uncommit command."""
18
18
 
32
32
        wt.add(['a', 'b', 'c'])
33
33
        wt.commit('initial commit', rev_id='a1')
34
34
 
35
 
        self.build_tree_contents([('tree/a', 'new contents of a\n')])
 
35
        open('tree/a', 'wb').write('new contents of a\n')
36
36
        wt.commit('second commit', rev_id='a2')
37
37
 
38
38
        return wt
103
103
        uncommit.uncommit(b)
104
104
        self.assertEqual(len(b.revision_history()), 2)
105
105
        self.assertEqual(len(t_a.branch.revision_history()), 2)
106
 
        # update A's tree to not have the uncommitted revision referenced.
 
106
        # update A's tree to not have the uncomitted revision referenced.
107
107
        t_a.update()
108
108
        t_a.commit('commit 3b')
109
109
        self.assertRaises(BoundBranchOutOfDate, uncommit.uncommit, b)
213
213
 
214
214
        self.assertEqual(['a2', 'b3', 'c3'], wt.get_parent_ids())
215
215
 
216
 
    def test_uncommit_shows_log_with_revision_id(self):
217
 
        wt = self.create_simple_tree()
218
 
 
219
 
        out, err = self.run_bzr('uncommit --force', working_dir='tree')
220
 
        self.assertContainsRe(out, r'second commit')
221
 
        self.assertContainsRe(err, r'You can restore the old tip by running')
222
 
        self.assertContainsRe(err, r'bzr pull . -r revid:a2')
223
 
 
224
216
    def test_uncommit_octopus_merge(self):
225
217
        # Check that uncommit keeps the pending merges in the same order
226
218
        # though it will also filter out ones in the ancestry
231
223
 
232
224
        tree2.commit('unchanged', rev_id='b3')
233
225
        tree3.commit('unchanged', rev_id='c3')
234
 
 
 
226
        
235
227
        wt.merge_from_branch(tree2.branch)
236
228
        wt.merge_from_branch(tree3.branch)
237
229
        wt.commit('merge b3, c3', rev_id='a3')