Rev 3229: merge --preview now works for merges that add or modify symlinks in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Feb 22 06:53:30 GMT 2008
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3229
revision-id:pqm at pqm.ubuntu.com-20080222065317-v0xvap07o35t0ymj
parent: pqm at pqm.ubuntu.com-20080220014008-9appc9kw4rjg8v1k
parent: james at jamesh.id.au-20080222011619-8mm40wtm4av4pmnj
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-02-22 06:53:17 +0000
message:
merge --preview now works for merges that add or modify symlinks
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
bzrlib/transform.py transform.py-20060105172343-dd99e54394d91687
------------------------------------------------------------
revno: 3228.1.3
revision-id:james at jamesh.id.au-20080222011619-8mm40wtm4av4pmnj
parent: james at jamesh.id.au-20080222005231-v0jc2dpf8vtgzbu5
committer: James Henstridge <james at jamesh.id.au>
branch nick: bzr.preview-symlink
timestamp: Fri 2008-02-22 10:16:19 +0900
message:
add NEWS entry
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
------------------------------------------------------------
revno: 3228.1.2
revision-id:james at jamesh.id.au-20080222005231-v0jc2dpf8vtgzbu5
parent: james at jamesh.id.au-20080222003900-ydgbr0oq20dto7a9
committer: James Henstridge <james at jamesh.id.au>
branch nick: bzr.preview-symlink
timestamp: Fri 2008-02-22 09:52:31 +0900
message:
Simplify test, and move it down to be next to the other _PreviewTree tests.
modified:
bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
------------------------------------------------------------
revno: 3228.1.1
revision-id:james at jamesh.id.au-20080222003900-ydgbr0oq20dto7a9
parent: pqm at pqm.ubuntu.com-20080220014008-9appc9kw4rjg8v1k
committer: James Henstridge <james at jamesh.id.au>
branch nick: bzr.preview-symlink
timestamp: Fri 2008-02-22 09:39:00 +0900
message:
* Add get_symlink_target() method to bzrlib.transform._PreviewTree, so
that "bzr merge --preview" works for trees with symlinks.
* Add a corresponding test.
modified:
bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
bzrlib/transform.py transform.py-20060105172343-dd99e54394d91687
=== modified file 'NEWS'
--- a/NEWS 2008-02-20 01:40:08 +0000
+++ b/NEWS 2008-02-22 01:16:19 +0000
@@ -26,6 +26,9 @@
* Include quick-start-summary.svg file to python-based installer(s)
for Windows (#192924, Alexander Belchenko)
+ * ``merge --preview`` now works for merges that add or modify
+ symlinks (James Henstridge)
+
API BREAKS:
TESTING:
=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py 2008-01-29 15:16:31 +0000
+++ b/bzrlib/tests/test_transform.py 2008-02-22 00:52:31 +0000
@@ -1967,3 +1967,11 @@
self.assertEqual('contents', tree_file.read())
finally:
tree_file.close()
+
+ def test_get_symlink_target(self):
+ self.requireFeature(SymlinkFeature)
+ preview = self.get_empty_preview()
+ preview.new_symlink('symlink', preview.root, 'target', 'symlink-id')
+ preview_tree = preview.get_preview_tree()
+ self.assertEqual('target',
+ preview_tree.get_symlink_target('symlink-id'))
=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py 2008-01-29 15:16:31 +0000
+++ b/bzrlib/transform.py 2008-02-22 00:39:00 +0000
@@ -1407,6 +1407,12 @@
name = self._transform._limbo_name(trans_id)
return open(name, 'rb')
+ def get_symlink_target(self, file_id):
+ """See Tree.get_symlink_target"""
+ trans_id = self._transform.trans_id_file_id(file_id)
+ name = self._transform._limbo_name(trans_id)
+ return os.readlink(name)
+
def paths2ids(self, specific_files, trees=None, require_versioned=False):
"""See Tree.paths2ids"""
return 'not_empty'
More information about the bazaar-commits
mailing list