Rev 816: Fix symlink setting during push. in file:///data/jelmer/bzr-svn/0.4/

Jelmer Vernooij jelmer at samba.org
Fri Jan 18 04:04:01 GMT 2008


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

------------------------------------------------------------
revno: 816
revision-id:jelmer at samba.org-20071221002135-bic9n1b3a31nrqzf
parent: jelmer at samba.org-20071219102841-bkyrkdrsfae8h4c0
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Fri 2007-12-21 01:21:35 +0100
message:
  Fix symlink setting during push.
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
  tests/test_push.py             test_push.py-20070201165715-g2ievcdfqi33wqsy-1
=== modified file 'NEWS'
--- a/NEWS	2007-12-19 00:15:17 +0000
+++ b/NEWS	2007-12-21 00:21:35 +0000
@@ -20,6 +20,8 @@
 
    * Improved compatibility with Subversion 1.5.
 
+   * Actually set symlink target when pushing commits that add or change symlinks.
+
 bzr-svn 0.4.5	2007-12-01
 
   IMPROVEMENTS

=== modified file 'commit.py'
--- a/commit.py	2007-11-05 21:59:01 +0000
+++ b/commit.py	2007-12-21 00:21:35 +0000
@@ -570,7 +570,8 @@
                 builder.modified_directory(id, [])
             id = builder.new_inventory[id].parent_id
 
-        if ie.kind == 'link':
+        assert ie.kind in ('symlink', 'file', 'directory')
+        if ie.kind == 'symlink':
             builder.modified_link(ie.file_id, [], ie.symlink_target)
         elif ie.kind == 'file':
             def get_text():

=== modified file 'tests/test_push.py'
--- a/tests/test_push.py	2007-11-05 13:46:26 +0000
+++ b/tests/test_push.py	2007-12-21 00:21:35 +0000
@@ -148,6 +148,23 @@
         self.assertEqual(repos.generate_revision_id(2, "", "none"),
                         self.svndir.open_branch().last_revision())
 
+    def test_symlink(self):
+        if os.name == 'win32':
+            return
+        os.symlink("bla", "dc/south")
+        assert os.path.islink("dc/south")
+        wt = self.bzrdir.open_workingtree()
+        wt.add('south')
+        wt.commit(message="Commit from Bzr")
+
+        self.svndir.open_branch().pull(self.bzrdir.open_branch())
+
+        repos = self.svndir.find_repository()
+        inv = repos.get_inventory(repos.generate_revision_id(2, "", "none"))
+        self.assertTrue(inv.has_filename('south'))
+        self.assertEquals('symlink', inv[inv.path2id('south')].kind)
+        self.assertEquals('bla', inv[inv.path2id('south')].symlink_target)
+
     def test_pull_after_push(self):
         self.build_tree({'dc/file': 'data'})
         wt = self.bzrdir.open_workingtree()




More information about the bazaar-commits mailing list