~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_commit.py

  • Committer: Aaron Bentley
  • Date: 2007-07-11 14:58:54 UTC
  • mto: This revision was merged to the branch mainline in revision 2606.
  • Revision ID: abentley@panoramicfeedback.com-20070711145854-06486yosdvexapy1
Got all tests passing with Branch returning 'null:' for null revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from cStringIO import StringIO
19
19
import os
20
20
 
21
 
from bzrlib import branch, bzrdir, errors, ui, workingtree
 
21
from bzrlib import (
 
22
    branch,
 
23
    bzrdir,
 
24
    errors,
 
25
    revision as _mod_revision,
 
26
    ui,
 
27
    uncommit,
 
28
    workingtree,
 
29
    )
22
30
from bzrlib.errors import (NotBranchError, NotVersionedError, 
23
31
                           UnsupportedOperation)
24
32
from bzrlib.osutils import pathjoin, getcwd, has_symlinks
152
160
            return
153
161
        tree.commit('foo', rev_id='foo', local=True)
154
162
        self.failIf(master.repository.has_revision('foo'))
155
 
        self.assertEqual(None, master.last_revision())
 
163
        self.assertTrue(_mod_revision.is_null(master.last_revision()))
156
164
 
157
165
    def test_record_initial_ghost(self):
158
166
        """The working tree needs to record ghosts during commit."""
383
391
             ],
384
392
            factory._calls
385
393
           )
 
394
 
 
395
 
 
396
class TestUncommit(TestCaseWithWorkingTree):
 
397
 
 
398
    def test_uncommit_to_null(self):
 
399
        tree = self.make_branch_and_tree('branch')
 
400
        tree.lock_write()
 
401
        revid = tree.commit('a revision')
 
402
        tree.unlock()
 
403
        uncommit.uncommit(tree.branch, tree=tree)
 
404
        self.assertEqual([], tree.get_parent_ids())