Rev 1745: Add blackbox test for missing. in file:///data/jelmer/bzr-svn/trunk/

Jelmer Vernooij jelmer at samba.org
Mon Sep 1 00:01:49 BST 2008


At file:///data/jelmer/bzr-svn/trunk/

------------------------------------------------------------
revno: 1745
revision-id: jelmer at samba.org-20080831230133-kx6785goz18qxv8q
parent: jelmer at samba.org-20080831221015-d8sebc42cp0lmy4v
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2008-09-01 01:01:33 +0200
message:
  Add blackbox test for missing.
modified:
  TODO                           todo-20060729211917-2kpobww0zyvvo0j2-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_blackbox.py         test_blackbox.py-20070325150839-d10llf8arptpcfl6-1
  workingtree.py                 workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file 'TODO'
--- a/TODO	2008-08-31 22:10:15 +0000
+++ b/TODO	2008-08-31 23:01:33 +0000
@@ -12,7 +12,6 @@
 tests:
 - more blackbox tests
  - svn-import without scheme specified should guess
- - bzr missing
 - add tests for objects returned by WorkingTree.pull(), Branch.pull()
 
 .svn working trees:

=== modified file 'repository.py'
--- a/repository.py	2008-08-31 17:34:49 +0000
+++ b/repository.py	2008-08-31 23:01:33 +0000
@@ -557,9 +557,7 @@
 
     def revision_tree(self, revision_id):
         """See Repository.revision_tree()."""
-        revision_id = ensure_null(revision_id)
-
-        if revision_id == NULL_REVISION:
+        if revision_id in (NULL_REVISION, None):
             inventory = Inventory(root_id=None)
             inventory.revision_id = revision_id
             return RevisionTree(self, inventory, revision_id)

=== modified file 'tests/test_blackbox.py'
--- a/tests/test_blackbox.py	2008-08-30 23:45:11 +0000
+++ b/tests/test_blackbox.py	2008-08-31 23:01:33 +0000
@@ -63,6 +63,23 @@
         self.run_bzr("push -d dc %s" % repos_url)
         self.check_output("", "status dc")
 
+    def test_missing(self):
+        repos_url = self.make_repository('d')
+        
+        self.run_bzr("init dc")
+
+        os.chdir("dc")
+        output, err = self.run_bzr("missing %s" % repos_url, retcode=1)
+        self.assertContainsRe(output, "You are missing 1 revision\\(s\\):")
+
+        dc = self.get_commit_editor(repos_url)
+        trunk = dc.add_dir('trunk')
+        trunk.add_file("trunk/foo").modify()
+        dc.close()
+
+        output, err = self.run_bzr("missing %s" % repos_url, retcode=1)
+        self.assertContainsRe(output, "You are missing 2 revision\\(s\\):")
+
     def test_push_overwrite(self):
         repos_url = self.make_repository('d')
         

=== modified file 'workingtree.py'
--- a/workingtree.py	2008-08-31 17:34:49 +0000
+++ b/workingtree.py	2008-08-31 23:01:33 +0000
@@ -416,7 +416,9 @@
 
                 child_path = os.path.join(path, name.decode("utf-8"))
 
-                if newrevtree.inventory[newrevtree.inventory.path2id(child_path)].kind == 'directory':
+                fileid = newrevtree.inventory.path2id(child_path)
+
+                if newrevtree.inventory[fileid].kind == 'directory':
                     subwc = WorkingCopy(wc, self.abspath(child_path).rstrip("/"), write_lock=True)
                     try:
                         update_settings(subwc, child_path)




More information about the bazaar-commits mailing list