[Pkg-bazaar-commits] r150 ./bzr-builddeb/people/jdw/merge_upstream: Merge trunk.

James Westby jw+debian at jameswestby.net
Tue Jul 10 21:02:32 UTC 2007


------------------------------------------------------------
revno: 150
committer: James Westby <jw+debian at jameswestby.net>
branch nick: merge_upstream
timestamp: Tue 2007-07-10 22:02:32 +0100
message:
  Merge trunk.
modified:
  README
  __init__.py
  builder.py
  config.py
  debian/changelog
  errors.py
  tests/test_builder.py
  util.py
    ------------------------------------------------------------
    revno: 104.1.15.1.4
    merged: jw+debian at jameswestby.net-20070710191544-231cr14z9ig9i3wq
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: trunk
    timestamp: Tue 2007-07-10 20:15:44 +0100
    message:
      Update the changelog for the last change.
    ------------------------------------------------------------
    revno: 104.1.15.1.3
    merged: jw+debian at jameswestby.net-20070710171207-fsr7jxovtszospz3
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: trunk
    timestamp: Tue 2007-07-10 18:12:07 +0100
    message:
      Overhaul the handling of dirty trees and unkowns.
      
        * Give a separate message for unknowns, and explain how to avoid it.
        * Only check for unknowns on -w.
        * Add a working-tree configuration option to make -w default.
    ------------------------------------------------------------
    revno: 104.1.15.1.2
    merged: jw+debian at jameswestby.net-20070708192305-5c132hnl90llxfbg
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: trunk
    timestamp: Sun 2007-07-08 20:23:05 +0100
    message:
      * Allow the changelog entries to have no author information.
    ------------------------------------------------------------
    revno: 104.1.15.1.1
    merged: jw+debian at jameswestby.net-20070625072431-sk7v0p7ovdgdd02r
    committer: James Westby <jw+debian at jameswestby.net>
    branch nick: trunk
    timestamp: Mon 2007-06-25 08:24:31 +0100
    message:
      * Remove any 'debian/' directory from the upstream tarball in merge mode,
        so that the branch contains all of the files that will appear there.
-------------- next part --------------
=== modified file 'README'
--- a/README	2007-07-10 20:52:45 +0000
+++ b/README	2007-07-10 21:02:32 +0000
@@ -204,6 +204,11 @@
 Others
 ######
 
+  * ``working-tree = True``
+
+    Always build the working tree, rather than the last revision committed
+    to the branch.
+
   * ``ignore-unknowns = True``
 
     Don't count unknown files in the tree as changes, and so allow the build

=== modified file '__init__.py'
--- a/__init__.py	2007-07-09 19:52:45 +0000
+++ b/__init__.py	2007-07-10 21:02:32 +0000
@@ -40,10 +40,11 @@
                      )
 from config import DebBuildConfig
 from errors import (ChangedError,
+                    UnknownsInTree,
                     StopBuild,
                     )
 from properties import BuildProperties
-from util import goto_branch, find_changelog, is_clean, tarball_name
+from util import goto_branch, find_changelog, tarball_name
 
 dont_purge_opt = Option('dont-purge',
     help="Don't purge the build directory after building")
@@ -228,13 +229,20 @@
             builder = "dpkg-buildpackage -uc -us -rfakeroot"
 
     if not working_tree:
+      working_tree = config.working_tree
+
+    if not working_tree:
       b = tree.branch
       rev_id = b.last_revision()
       info("Building branch from revision %s", rev_id)
       t = b.repository.revision_tree(rev_id)
-      if not ignore_changes and not is_clean(t, tree, ignore_unknowns):
-        raise ChangedError
+      if not ignore_changes:
+        changes = tree.changes_from(t)
+        if changes.has_changed():
+          raise ChangedError
     else:
+      if not ignore_unknowns and len(list(tree.unknowns())) > 0:
+        raise UnknownsInTree
       info("Building using working tree")
       t = tree
 

=== modified file 'builder.py'
--- a/builder.py	2007-07-08 10:19:58 +0000
+++ b/builder.py	2007-07-10 21:02:32 +0000
@@ -246,6 +246,8 @@
       export(tree,export_dir,None,None)
     finally:
       tree.unlock()
+    if os.path.exists(os.path.join(source_dir, 'debian')):
+      shutil.rmtree(os.path.join(source_dir, 'debian'))
     recursive_copy(tempdir, source_dir)
     shutil.rmtree(basetempdir)
     remove_bzrbuilddeb_dir(os.path.join(source_dir, "debian"))

=== modified file 'config.py'
--- a/config.py	2007-07-01 14:23:31 +0000
+++ b/config.py	2007-07-10 21:02:32 +0000
@@ -218,6 +218,9 @@
   ignore_unknowns = _bool_property('ignore-unknowns',
                          "Build even when the tree has unknowns")
 
+  working_tree = _bool_property('working-tree',
+                         "Always build the working tree.")
+
   native = _bool_property('native', "Build a native package")
 
   split = _bool_property('split', "Split a full source package")

=== modified file 'debian/changelog'
--- a/debian/changelog	2007-06-18 21:57:14 +0000
+++ b/debian/changelog	2007-07-10 19:15:44 +0000
@@ -1,3 +1,13 @@
+bzr-builddeb (0.17.1) unstable; urgency=low
+
+  * Remove any 'debian/' directory from the upstream tarball in merge mode,
+    so that the branch contains all of the files that will appear there.
+  * Allow the changelog entries to have no author information.
+  * Add a working-tree option to the configuration files that if set always
+    builds the working tree rather than the last revision in the branch. 
+
+ -- James Westby <jw+debian at jameswestby.net>  Tue, 10 Jul 2007 20:15:13 +0100
+
 bzr-builddeb (0.17) unstable; urgency=low
 
   [ James Westby ]

=== modified file 'errors.py'
--- a/errors.py	2007-06-26 18:45:53 +0000
+++ b/errors.py	2007-07-10 21:02:32 +0000
@@ -29,11 +29,26 @@
     self.message = message
 
 class ChangedError(DebianError):
-  _fmt = """There are modified files in the working tree. Either commit the 
-  changes, use --working to build the working tree, or --ignore-changes
-  to override this and build the branch without the changes in the working 
-  tree. Use bzr status to see the changes"""
-
+  _fmt = ("There are modified files in the working tree. Either commit the "
+         "changes, use --working to build the working tree, or "
+         "--ignore-changes to override this and build the branch without "
+         "the changes in the working tree. Use bzr status to see the changes. "
+         "To disable this check and always build the working tree see the "
+         "documentation of the working-tree configuration option in the README. "
+         )
+
+  def __init__(self):
+    DebianError.__init__(self, None)
+
+class UnknownsInTree(DebianError):
+  _fmt = ("There are unknown files in the working tree. The build will not "
+         "continue as you may want these files included in the build. If you "
+         "do want them then use 'bzr add' to add them to the tree. If you do "
+         "not then use the '--ignore-unknowns' option to 'builddeb'. To disable "
+         "this check then see the documentation of the 'ignore-unkowns' "
+         "configuration option in the README."
+         )
+ 
   def __init__(self):
     DebianError.__init__(self, None)
 

=== modified file 'tests/test_builder.py'
--- a/tests/test_builder.py	2007-07-01 14:23:31 +0000
+++ b/tests/test_builder.py	2007-07-10 21:02:32 +0000
@@ -769,7 +769,8 @@
 
   def test_export_handles_debian_in_upstream(self):
     """Make sure export can handle upstream shipping debian/ as well."""
-    self.upstream_files = self.upstream_files + ['debian/', 'debian/changelog']
+    self.upstream_files = self.upstream_files + ['debian/', 'debian/changelog',
+                                                 'debian/install']
     wt = self._make_branch()
     basedir = 'debian/'
     files = [basedir]
@@ -792,6 +793,7 @@
     finally:
       f.close()
     self.assertEqual(contents, 'branch')
+    self.failIfExists(join(self.source_dir, basedir, 'install'))
 
 
 class TestMergeExportUpstreamBuilder(BuilderTestCase):

=== modified file 'util.py'
--- a/util.py	2007-07-08 10:19:58 +0000
+++ b/util.py	2007-07-10 21:02:32 +0000
@@ -44,18 +44,6 @@
       shutil.copy(path, todir)
 
 
-def is_clean(oldtree, newtree, ignore_unknowns=False):
-  """Return True if there are no uncommited changes or unknown files.
-  
-  If ignore_unknowns is True then unknown files do not count as changes."""
-
-  changes = newtree.changes_from(oldtree)
-  if changes.has_changed():
-    return False
-  if not ignore_unknowns and len(list(newtree.unknowns())) > 0:
-    return False
-  return True
-
 def goto_branch(branch):
   """Changes to the specified branch dir if it is not None"""
   if branch is not None:
@@ -88,7 +76,8 @@
       contents = t.get_file_text(changelog_id)
     finally:
       t.unlock()
-    changelog = Changelog(contents, max_blocks=1)
+    changelog = Changelog()
+    changelog.parse_changelog(contents, max_blocks=1, allow_empty_author=True)
     return changelog, larstiq
 
 def tarball_name(package, version):



More information about the Pkg-bazaar-commits mailing list