Rev 6545: (gz) Create working tree at specified revision when doing a local push in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Sat Jul 28 15:16:40 UTC 2012


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6545 [merge]
revision-id: pqm at pqm.ubuntu.com-20120728151639-ryaymw3kp1yqrrdx
parent: pqm at pqm.ubuntu.com-20120728133959-zmycu56kx99zttog
parent: gzlist at googlemail.com-20120728144645-jxkasxykcs53kn2k
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2012-07-28 15:16:39 +0000
message:
  (gz) Create working tree at specified revision when doing a local push
   (Martin Packman)
modified:
  bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
  doc/en/release-notes/bzr-2.6.txt bzr2.6.txt-20120116134316-8w1xxom1c7vcu1t5-1
=== modified file 'bzrlib/tests/blackbox/test_push.py'
--- a/bzrlib/tests/blackbox/test_push.py	2012-04-16 11:08:11 +0000
+++ b/bzrlib/tests/blackbox/test_push.py	2012-07-04 18:02:31 +0000
@@ -452,6 +452,8 @@
         self.assertTrue(repo_to.has_revision('from-1'))
         self.assertFalse(repo_to.has_revision('from-2'))
         self.assertEqual(tree_to.branch.last_revision_info()[1], 'from-1')
+        self.assertFalse(
+            tree_to.changes_from(tree_to.basis_tree()).has_changed())
 
         self.run_bzr_error(
             ['bzr: ERROR: bzr push --revision '
@@ -917,3 +919,28 @@
             2>All changes applied successfully.
             2>Pushed up to revision 1.
             """)
+
+    def test_push_with_revspec(self):
+        self.run_script("""
+            $ bzr init-repo .
+            Shared repository with trees (format: 2a)
+            Location:
+              shared repository: .
+            $ bzr init trunk
+            Created a repository tree (format: 2a)
+            Using shared repository...
+            $ cd trunk
+            $ bzr commit -m 'first rev' --unchanged
+            2>Committing to:...trunk/
+            2>Committed revision 1.
+            $ echo foo > file
+            $ bzr add
+            adding file
+            $ bzr commit -m 'we need some foo'
+            2>Committing to:...trunk/
+            2>added file
+            2>Committed revision 2.
+            $ bzr push -r 1 ../other
+            2>Created new branch.
+            $ bzr st ../other # checking that file is not created (#484516)
+            """)

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2012-07-18 20:06:21 +0000
+++ b/bzrlib/workingtree.py	2012-07-28 14:46:45 +0000
@@ -535,7 +535,12 @@
         else:
             # TODO now merge from tree.last_revision to revision (to preserve
             # user local changes)
-            merge.transform_tree(tree, self)
+            try:
+                other_tree = self.revision_tree(revision_id)
+            except errors.NoSuchRevision:
+                other_tree = self.branch.repository.revision_tree(revision_id)
+
+            merge.transform_tree(tree, other_tree)
             if revision_id == _mod_revision.NULL_REVISION:
                 new_parents = []
             else:

=== modified file 'doc/en/release-notes/bzr-2.6.txt'
--- a/doc/en/release-notes/bzr-2.6.txt	2012-07-25 10:11:07 +0000
+++ b/doc/en/release-notes/bzr-2.6.txt	2012-07-28 14:46:45 +0000
@@ -39,6 +39,9 @@
 * When a missing referenced chk root error is encountered, bzr now suggests
   running ``bzr reconcile --canonicalize-chks``. (Jelmer Vernooij, #1021537)
 
+* When pushing a specific revision, create the new working tree at
+  that revision. (#484516, Neil Martinsen-Burrell)
+
 Documentation
 *************
 
@@ -113,7 +116,6 @@
 * Option values set on locked branches should be saved only when the branch
   is finally unlocked. (Vincent Ladeuil, #948339)
 
-
 Documentation
 *************
 




More information about the bazaar-commits mailing list