Merge lp:~mbp/bzr/prepare-2.1 into lp:bzr/2.1

Proposed by Martin Pool
Status: Merged
Approved by: Martin Pool
Approved revision: no longer in the source branch.
Merged at revision: 4853
Proposed branch: lp:~mbp/bzr/prepare-2.1
Merge into: lp:bzr/2.1
Diff against target: 271 lines (+160/-10)
9 files modified
NEWS (+11/-0)
bzrlib/builtins.py (+1/-1)
bzrlib/mutabletree.py (+4/-0)
bzrlib/tests/__init__.py (+1/-0)
bzrlib/tests/per_workingtree/__init__.py (+2/-1)
bzrlib/tests/per_workingtree/test_symlinks.py (+98/-0)
bzrlib/tests/test_treeshape.py (+41/-0)
bzrlib/tests/test_upgrade.py (+0/-6)
bzrlib/tests/treeshape.py (+2/-2)
To merge this branch: bzr merge lp:~mbp/bzr/prepare-2.1
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+30432@code.launchpad.net

Commit message

merge 2.0 to 2.1

Description of the change

merge from 2.0 into 2.1

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/prepare-2.1 into lp:bzr/2.1.
>
> Requested reviews:
> bzr-core (bzr-core)
> Related bugs:
> #513432 AttributeError: 'Inter1and2Helper' object has no attribute 'source_repo'
> https://bugs.launchpad.net/bugs/513432
>
>
> merge from 2.0 into 2.1
>

 merge: approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxFySYACgkQJdeBCYSNAAMgWQCcDRcBVR6aenbAF3mMQOHD1ej2
lgAAn2aKwqvT5feYsuSVDdYn1haC2Z6m
=W5ge
-----END PGP SIGNATURE-----

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2010-07-14 10:11:45 +0000
+++ NEWS 2010-07-20 15:53:45 +0000
@@ -506,6 +506,10 @@
506 history no longer crash when deleted files are involved.506 history no longer crash when deleted files are involved.
507 (Vincent Ladeuil, John Arbash Meinel, #375898)507 (Vincent Ladeuil, John Arbash Meinel, #375898)
508508
509* ``bzr commit SYMLINK`` now works, rather than trying to commit the
510 target of the symlink.
511 (Martin Pool, John Arbash Meinel, #128562)
512
509* ``bzr revert`` now only takes write lock on working tree, instead of on 513* ``bzr revert`` now only takes write lock on working tree, instead of on
510 both working tree and branch.514 both working tree and branch.
511 (Danny van Heumen, #498409)515 (Danny van Heumen, #498409)
@@ -545,6 +549,13 @@
545 (John Arbash Meinel, #583486)549 (John Arbash Meinel, #583486)
546550
547551
552Testing
553*******
554
555* ``build_tree_contents`` can create symlinks.
556 (Martin Pool, John Arbash Meinel)
557
558
548bzr 2.0.5559bzr 2.0.5
549#########560#########
550561
551562
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py 2010-04-15 08:50:40 +0000
+++ bzrlib/builtins.py 2010-07-20 15:53:45 +0000
@@ -175,7 +175,7 @@
175 view_str = views.view_display_str(view_files)175 view_str = views.view_display_str(view_files)
176 note("Ignoring files outside view. View is %s" % view_str)176 note("Ignoring files outside view. View is %s" % view_str)
177 return tree, file_list177 return tree, file_list
178 tree = WorkingTree.open_containing(osutils.realpath(file_list[0]))[0]178 tree = WorkingTree.open_containing(file_list[0])[0]
179 return tree, safe_relpath_files(tree, file_list, canonicalize,179 return tree, safe_relpath_files(tree, file_list, canonicalize,
180 apply_view=apply_view)180 apply_view=apply_view)
181181
182182
=== modified file 'bzrlib/mutabletree.py'
--- bzrlib/mutabletree.py 2009-10-06 14:40:37 +0000
+++ bzrlib/mutabletree.py 2010-07-20 15:53:45 +0000
@@ -362,6 +362,10 @@
362 This is designed more towards DWIM for humans than API clarity.362 This is designed more towards DWIM for humans than API clarity.
363 For the specific behaviour see the help for cmd_add().363 For the specific behaviour see the help for cmd_add().
364364
365 :param file_list: List of zero or more paths. *NB: these are
366 interpreted relative to the process cwd, not relative to the
367 tree.* (Add and most other tree methods use tree-relative
368 paths.)
365 :param action: A reporter to be called with the inventory, parent_ie,369 :param action: A reporter to be called with the inventory, parent_ie,
366 path and kind of the path being added. It may return a file_id if370 path and kind of the path being added. It may return a file_id if
367 a specific one should be used.371 a specific one should be used.
368372
=== modified file 'bzrlib/tests/__init__.py'
--- bzrlib/tests/__init__.py 2010-05-19 23:09:33 +0000
+++ bzrlib/tests/__init__.py 2010-07-20 15:53:45 +0000
@@ -3728,6 +3728,7 @@
3728 'bzrlib.tests.test_transport_log',3728 'bzrlib.tests.test_transport_log',
3729 'bzrlib.tests.test_tree',3729 'bzrlib.tests.test_tree',
3730 'bzrlib.tests.test_treebuilder',3730 'bzrlib.tests.test_treebuilder',
3731 'bzrlib.tests.test_treeshape',
3731 'bzrlib.tests.test_tsort',3732 'bzrlib.tests.test_tsort',
3732 'bzrlib.tests.test_tuned_gzip',3733 'bzrlib.tests.test_tuned_gzip',
3733 'bzrlib.tests.test_ui',3734 'bzrlib.tests.test_ui',
37343735
=== modified file 'bzrlib/tests/per_workingtree/__init__.py'
--- bzrlib/tests/per_workingtree/__init__.py 2009-08-04 04:36:34 +0000
+++ bzrlib/tests/per_workingtree/__init__.py 2010-07-20 15:53:45 +0000
@@ -1,4 +1,4 @@
1# Copyright (C) 2006, 2007 Canonical Ltd1# Copyright (C) 2006, 2007, 2010 Canonical Ltd
2#2#
3# This program is free software; you can redistribute it and/or modify3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by4# it under the terms of the GNU General Public License as published by
@@ -101,6 +101,7 @@
101 'revision_tree',101 'revision_tree',
102 'set_root_id',102 'set_root_id',
103 'smart_add',103 'smart_add',
104 'symlinks',
104 'uncommit',105 'uncommit',
105 'unversion',106 'unversion',
106 'views',107 'views',
107108
=== added file 'bzrlib/tests/per_workingtree/test_symlinks.py'
--- bzrlib/tests/per_workingtree/test_symlinks.py 1970-01-01 00:00:00 +0000
+++ bzrlib/tests/per_workingtree/test_symlinks.py 2010-07-20 15:53:45 +0000
@@ -0,0 +1,98 @@
1# Copyright (C) 2010 Canonical Ltd
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
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
16
17"""Test symlink support.
18
19See eg <https://bugs.launchpad.net/bzr/+bug/192859>
20"""
21
22from bzrlib import (
23 builtins,
24 tests,
25 workingtree,
26 )
27from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
28
29
30class TestSmartAddTree(TestCaseWithWorkingTree):
31
32 _test_needs_features = [tests.SymlinkFeature]
33
34 def test_smart_add_symlink(self):
35 tree = self.make_branch_and_tree('tree')
36 self.build_tree_contents([
37 ('tree/link@', 'target'),
38 ])
39 tree.smart_add(['tree/link'])
40 self.assertIsNot(None, tree.path2id('link'))
41 self.assertIs(None, tree.path2id('target'))
42 self.assertEqual('symlink',
43 tree.kind(tree.path2id('link')))
44
45 def test_smart_add_symlink_pointing_outside(self):
46 tree = self.make_branch_and_tree('tree')
47 self.build_tree_contents([
48 ('tree/link@', '../../../../target'),
49 ])
50 tree.smart_add(['tree/link'])
51 self.assertIsNot(None, tree.path2id('link'))
52 self.assertIs(None, tree.path2id('target'))
53 self.assertEqual('symlink',
54 tree.kind(tree.path2id('link')))
55
56 def test_open_containing_through_symlink(self):
57 self.make_test_tree()
58 self.check_open_containing('link/content', 'tree', 'content')
59 self.check_open_containing('link/sublink', 'tree', 'sublink')
60 # this next one is a bit debatable, but arguably it's better that
61 # open_containing is only concerned with opening the tree
62 # and then you can deal with symlinks along the way if you want
63 self.check_open_containing('link/sublink/subcontent', 'tree',
64 'sublink/subcontent')
65
66 def check_open_containing(self, to_open, expected_tree_name,
67 expected_relpath):
68 wt, relpath = workingtree.WorkingTree.open_containing(to_open)
69 self.assertEquals(relpath, expected_relpath)
70 self.assertEndsWith(wt.basedir, expected_tree_name)
71
72 def test_tree_files(self):
73 # not strictly a WorkingTree method, but it should be
74 # probably the root cause for
75 # <https://bugs.launchpad.net/bzr/+bug/128562>
76 self.make_test_tree()
77 self.check_tree_files(['tree/outerlink'],
78 'tree', ['outerlink'])
79 self.check_tree_files(['link/outerlink'],
80 'tree', ['outerlink'])
81 self.check_tree_files(['link/sublink/subcontent'],
82 'tree', ['subdir/subcontent'])
83
84 def check_tree_files(self, to_open, expected_tree, expect_paths):
85 tree, relpaths = builtins.tree_files(to_open)
86 self.assertEndsWith(tree.basedir, expected_tree)
87 self.assertEquals(expect_paths, relpaths)
88
89 def make_test_tree(self):
90 tree = self.make_branch_and_tree('tree')
91 self.build_tree_contents([
92 ('link@', 'tree'),
93 ('tree/outerlink@', '/not/there'),
94 ('tree/content', 'hello'),
95 ('tree/sublink@', 'subdir'),
96 ('tree/subdir/',),
97 ('tree/subdir/subcontent', 'subcontent stuff')
98 ])
099
=== added file 'bzrlib/tests/test_treeshape.py'
--- bzrlib/tests/test_treeshape.py 1970-01-01 00:00:00 +0000
+++ bzrlib/tests/test_treeshape.py 2010-07-20 15:53:45 +0000
@@ -0,0 +1,41 @@
1# Copyright (C) 2010 Canonical Ltd
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
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
16
17
18import os
19
20
21from bzrlib import tests
22
23
24class TestTreeShape(tests.TestCaseWithTransport):
25
26 def test_build_tree(self):
27 """Test tree-building test helper"""
28 self.build_tree_contents([
29 ('foo', 'new contents'),
30 ('.bzr/',),
31 ('.bzr/README', 'hello'),
32 ])
33 self.failUnlessExists('foo')
34 self.failUnlessExists('.bzr/README')
35 self.assertFileEqual('hello', '.bzr/README')
36
37 def test_build_tree_symlink(self):
38 self.requireFeature(tests.SymlinkFeature)
39 self.build_tree_contents([('link@', 'target')])
40 self.assertEqual('target',
41 os.readlink('link'))
042
=== modified file 'bzrlib/tests/test_upgrade.py'
--- bzrlib/tests/test_upgrade.py 2009-05-07 05:08:46 +0000
+++ bzrlib/tests/test_upgrade.py 2010-07-20 15:53:45 +0000
@@ -43,12 +43,6 @@
4343
44class TestUpgrade(TestCaseWithTransport):44class TestUpgrade(TestCaseWithTransport):
4545
46 def test_build_tree(self):
47 """Test tree-building test helper"""
48 self.build_tree_contents(_upgrade1_template)
49 self.failUnlessExists('foo')
50 self.failUnlessExists('.bzr/README')
51
52 def test_upgrade_simple(self):46 def test_upgrade_simple(self):
53 """Upgrade simple v0.0.4 format to latest format"""47 """Upgrade simple v0.0.4 format to latest format"""
54 eq = self.assertEquals48 eq = self.assertEquals
5549
=== modified file 'bzrlib/tests/treeshape.py'
--- bzrlib/tests/treeshape.py 2009-03-23 14:59:43 +0000
+++ bzrlib/tests/treeshape.py 2010-07-20 15:53:45 +0000
@@ -1,4 +1,4 @@
1# Copyright (C) 2005 Canonical Ltd1# Copyright (C) 2005, 2010 Canonical Ltd
2#2#
3# This program is free software; you can redistribute it and/or modify3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by4# it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@
47 if name[-1] == '/':47 if name[-1] == '/':
48 os.mkdir(name)48 os.mkdir(name)
49 elif name[-1] == '@':49 elif name[-1] == '@':
50 raise NotImplementedError('symlinks not handled yet')50 os.symlink(tt[1], tt[0][:-1])
51 else:51 else:
52 f = file(name, 'wb')52 f = file(name, 'wb')
53 try:53 try:

Subscribers

People subscribed via source and target branches