[Pkg-bazaar-commits] ./bzr-upload/unstable r49: Package new upstream release.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:24:00 UTC 2009


------------------------------------------------------------
revno: 49
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: debian
timestamp: Sat 2008-11-08 19:14:34 +0100
message:
  Package new upstream release.
modified:
  __init__.py
  debian/changelog
  tests/test_upload.py
    ------------------------------------------------------------
    revno: 43.1.9
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: upload
    timestamp: Tue 2008-09-16 08:51:08 +0200
    message:
      Fix bug #270219 by handling content changes during renames.
      
      * tests/test_upload.py:
      (TestUploadMixin.test_rename_and_change_file): Reproduce bug
      #270219.
      
      * __init__.py:
      (BzrUploader.upload_tree): Content modifications can be a special
      case of renames.
    modified:
      __init__.py
      tests/test_upload.py
    ------------------------------------------------------------
    revno: 43.1.10
    committer: Martin Albisetti <martin.albisetti at canonical.com>
    branch nick: upload
    timestamp: Wed 2008-10-15 22:11:28 -0300
    message:
      Don't try and register the hook if install_named_hook is not available
    modified:
      __init__.py
        ------------------------------------------------------------
        revno: 43.4.1
        committer: James Westby <jw+debian at jameswestby.net>
        branch nick: upload
        timestamp: Mon 2008-09-22 16:03:44 +0100
        message:
          Don't try and register the hook if install_named_hook is not available
          
          This would prevent the plugin from loading on older versions of bzr.
          
          If the hook can't be registered then give the user an error if they
          use --auto, as a warning that it won't have any effect.
        modified:
          __init__.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2008-08-08 10:51:37 +0000
+++ b/__init__.py	2008-11-08 18:14:34 +0000
@@ -58,7 +58,7 @@
     )
 """)
 
-version_info = (0,1,0)
+version_info = (0, 1, 1)
 plugin_name = 'upload'
 
 
@@ -279,6 +279,10 @@
 
             for (old_path, new_path, id, kind,
                  content_change, exec_change) in changes.renamed:
+                if content_change:
+                    # We update the old_path content because renames and
+                    # deletions are differed.
+                    self.upload_file(old_path, id)
                 self.rename_remote(old_path, new_path)
             self.finish_renames()
             self.finish_deletions()
@@ -349,6 +353,10 @@
         if directory is None:
             directory = u'.'
 
+        if auto and not auto_hook_available:
+            raise BzrCommandError("Your version of bzr does not have the "
+                    "hooks necessary for --auto to work")
+
         wt = workingtree.WorkingTree.open_containing(directory)[0]
         changes = wt.changes_from(wt.basis_tree())
 
@@ -400,9 +408,14 @@
 
 from bzrlib.plugins.upload.auto_upload_hook import auto_upload_hook
 
-branch.Branch.hooks.install_named_hook('post_change_branch_tip',
-        auto_upload_hook,
-        'Auto upload code from a branch when it is changed.')
+
+if hasattr(branch.Branch.hooks, "install_named_hook"):
+    branch.Branch.hooks.install_named_hook('post_change_branch_tip',
+            auto_upload_hook,
+            'Auto upload code from a branch when it is changed.')
+    auto_hook_available = True
+else:
+    auto_hook_available = False
 
 
 def load_tests(basic_tests, module, loader):

=== modified file 'debian/changelog'
--- a/debian/changelog	2008-08-08 10:51:37 +0000
+++ b/debian/changelog	2008-11-08 18:14:34 +0000
@@ -1,3 +1,9 @@
+bzr-upload (0.1.1-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Jelmer Vernooij <jelmer at samba.org>  Sat, 08 Nov 2008 19:14:01 +0100
+
 bzr-upload (0.1.0~bzr51-1) unstable; urgency=low
 
   * New upstream snapshot.

=== modified file 'tests/test_upload.py'
--- a/tests/test_upload.py	2008-08-02 15:54:28 +0000
+++ b/tests/test_upload.py	2008-09-16 06:51:08 +0000
@@ -301,6 +301,19 @@
 
         self.assertUpFileEqual('foo', 'goodbye')
 
+    def test_rename_and_change_file(self):
+        self.make_local_branch()
+        self.add_file('hello', 'foo')
+        self.do_full_upload()
+        self.rename_any('hello', 'goodbye')
+        self.modify_file('goodbye', 'bar')
+
+        self.assertUpFileEqual('foo', 'hello')
+
+        self.do_upload()
+
+        self.assertUpFileEqual('bar', 'goodbye')
+
     def test_rename_two_files(self):
         self.make_local_branch()
         self.add_file('a', 'foo')



More information about the Pkg-bazaar-commits mailing list