[Pkg-bazaar-commits] ./bzr-fastimport/unstable r104: * New upstream snapshot.

Jelmer Vernooij jelmer at debian.org
Fri Jul 24 14:19:33 UTC 2009


------------------------------------------------------------
revno: 104
committer: Jelmer Vernooij <jelmer at debian.org>
branch nick: debian
timestamp: Fri 2009-07-24 16:19:33 +0200
message:
  * New upstream snapshot.
  * Bump standards version to 3.8.2.
modified:
  NEWS
  __init__.py
  bzr_commit_handler.py
  debian/changelog
  debian/control
  exporters/hg-fast-export.README
  exporters/hg-fast-export.py
  exporters/hg2git.py
  parser.py
  setup.py
  tests/test_parser.py
    ------------------------------------------------------------
    revno: 85.7.70
    author: Lars Hoss
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: integration
    timestamp: Thu 2009-07-02 13:40:50 +1000
    message:
      Add missing import
    modified:
      branch_updater.py
    ------------------------------------------------------------
    revno: 85.7.71
    committer: Ian Clatworthy <ian.clatworthy at canonical.com>
    branch nick: trunk
    timestamp: Mon 2009-07-20 14:53:33 +1000
    message:
      Here-document style commit messages (Samuel Bronson)
    modified:
      parser.py
      tests/test_parser.py
        ------------------------------------------------------------
        revno: 85.20.1
        committer: Samuel Bronson <naesten at gmail.com>
        branch nick: fastimport
        timestamp: Sat 2009-07-18 19:07:37 -0400
        message:
          Add a test for bug #400960.
        modified:
          tests/test_parser.py
        ------------------------------------------------------------
        revno: 85.20.2
        committer: Samuel Bronson <naesten at gmail.com>
        branch nick: fastimport
        timestamp: Sat 2009-07-18 19:09:23 -0400
        message:
          Implement here-document style input data.
          
          Fixes bug #400960.
        modified:
          parser.py
    ------------------------------------------------------------
    revno: 85.7.72
    committer: Ian Clatworthy <ian.clatworthy at canonical.com>
    branch nick: trunk
    timestamp: Thu 2009-07-23 11:31:28 +1000
    message:
      release 0.8
    modified:
      NEWS
      __init__.py
      setup.py
    ------------------------------------------------------------
    revno: 85.7.73
    committer: Ian Clatworthy <ian.clatworthy at canonical.com>
    branch nick: trunk
    timestamp: Thu 2009-07-23 11:55:44 +1000
    message:
      Open 0.9 development
    modified:
      NEWS
      __init__.py
      setup.py
    ------------------------------------------------------------
    revno: 85.7.74
    committer: Ian Clatworthy <ian.clatworthy at canonical.com>
    branch nick: trunk
    timestamp: Thu 2009-07-23 14:55:18 +1000
    message:
      Integate latest (25-May-2009) hg-fast-export
    modified:
      exporters/hg-fast-export.README
      exporters/hg-fast-export.py
      exporters/hg2git.py
    ------------------------------------------------------------
    revno: 85.7.75
    committer: Ian Clatworthy <ian.clatworthy at canonical.com>
    branch nick: trunk
    timestamp: Thu 2009-07-23 16:56:36 +1000
    message:
      fix inv-delta generation when deleting directories
    modified:
      bzr_commit_handler.py
    ------------------------------------------------------------
    revno: 85.7.76
    committer: Ian Clatworthy <ian.clatworthy at canonical.com>
    branch nick: trunk
    timestamp: Thu 2009-07-23 17:03:35 +1000
    message:
      update NEWS
    modified:
      NEWS
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2009-03-12 07:44:22 +0000
+++ b/NEWS	2009-07-23 07:03:35 +0000
@@ -1,237 +1,276 @@
-----------------------------
+============================
 bzr-fastimport Release Notes
-----------------------------
+============================
 
 .. contents::
 
-IN DEVELOPMENT
---------------
-
-  COMPATIBILITY BREAKS:
-
-    * ``exporters/bzr-fast-export`` has been replaced with a
-      ``fast-export`` command. Some minor issues have been
-      fixed at the same time: the first commit now goes into
-      refs/heads/master (not refs/head/tmp); there's no
-      checkpoint at the top of the stream; parent commits are
-      now always given lower mark numbers than the commits they
-      are merged into. (Ian Clatworthy)
-
-    * The ``fast-import`` command now uses a different mapping of
-      git reference names to bzr branch names. In summary:
-      
-      * ``refs/heads/foo`` is mapped to ``foo``
-      * ``refs/remotes/origin/foo`` is mapped to ``foo.remote``
-      * ``refs/tags/foo`` is mapped to ``foo.tag``
-      * ``*/master`` is mapped to ``trunk``, ``trunk.remote``, etc.
-      * ``*/trunk`` is mapped to ``git-trunk``, ``git-trunk.remote``, etc.
-
-      This new mapping has been introduced so that more natural
-      branch names are used and to enable round-tripping back to git.
-      (Ian Clatworthy)
-
-    * The old ``fast-import-filter`` command is now called
-      ``fast-import-query``. ``fast-import-filter`` now
-      really filters the input to produce a fast-import stream
-      based on filtering criteria. See below.
-      (Ian Clatworthy)
-
-    * The ``--inv-fulltext`` option is no longer supported. It was
-      only used in experimental mode for old versions of bzrlib so
-      it added more complexity than value. (Ian Clatworthy)
-
-  FEATURES:
-
-    * Added ``fast-import-filter`` command for splitting out a
-      subdirectory or bunch of files into their own project. It can
-      also be used to create a new repository without any history
-      for nominated files and directories. This is useful for
-      removing information which is a security risk, huge binary
-      files like ISO images, etc.
-      (Ian Clatworthy)
-
-    * Copying of files and symbolic links is now supported.
-      (Ian Clatworthy)
-
-    * Initial cut at reset support. (Brian de Alwis, Ian Clatworthy)
-
-  IMPROVEMENTS:
-
-    * If ``refs/heads/xxx`` and ``refs/remotes/origin/xxx`` are both
-      defined, the latter is now mapped to a bzr branch called
-      ``xxx.remote`` rather than ``remotes--origins--xxx``.
-      (Ian Clatworthy)
-
-    * ``bzr fast-import-info`` now handles an unlimited # of parents for a
-      revision. The spec suggests the maximum ought to be 16 but the linux
-      kernel has revisions with more than that.
-      (Ian Clatworthy)
-
-    * ``bzr fast-import-info`` now reports on things that may need caching,
-      i.e. merges, rename old paths and copy source paths.
-      (Ian Clatworthy)
-
-    * Tag commands with a missing from clause now produce a warning but
-      are otherwise ignored. (Scott James Remnant, Ian Clatworthy)
-
-    * The fastimport-id-map file can now have more revisions than the
-      repository. (Scott James Remnant)
-
-    * Updated the bundled version of hg-fast-export to be the latest
-      code from http://repo.or.cz/w/fast-export.git. It should now
-      support recent Mercurial releases.
-      (Ian Clatworthy, #318903)
-
-  BUG FIXES:
-
-    * Fixed a *bad* bug where filecopy commands were being parsed
-      as filerename commands. Repositories generated by previous
-      version of bzr-fast-import where the input stream contained
-      filecopy commands might be missing data (the copy source will
-      no longer be there if it was unchanged since the copy happened)
-      and ought to be regenerated.
-      (Ian Clatworthy)
-
-    * Fixed how the per-file graph is generated. The per-file graph
-      may still be less than perfect in the case where a file is only
-      changed in a merge and not the parent, but in the vast majority
-      of cases now, ``bzr check`` should no longer report inconsistent
-      parents. (Ian Clatworthy)
-
-    * Fix ``os`` import as needed on Windows.
-      (Ian Clatworthy, esskov, #264988)
-
-    * Handle a directory turning into a file and then the children
-      of that directory being deleted.
-      (Ian Clatworthy, #309486)
-
-    * Handle an empty email section.
-      (Ian Clatworthy)
-
-    * Handle multiple merges within the one merge clause. That's illegal
-      according to the spec but git-fast-export does it.
-      (Ian Clatworthy, #259711)
-
-    * Handle names and paths that aren't utf8 encoded. The spec recommends
-      utf8 encoding of these but git-fast-export doesn't always do that.
-      (Ian Clatworthy, #289088)
-
-    * Ignore lightweight tags with no from clause rather than abort.
-      (It seems git-fast-export outputs these commands frequently now
-      while it didn't appear to in early versions.)
-      (Ian Clatworthy, edice, #259711)
-
-    * Import into rich-root (and subtree) repositories without aborting.
-      (Ian Clatworthy, #300921)
-
-    * Recursively delete children when a directory is deleted.
-      (Scott James Remnant)
-
-    * The ``deleteall`` command now only tries to delete files in the
-      nominated branch, not all known files. As a consequence,
-      it should now be possible (if it wasn't before) to import
-      multiple Darcs branches (via darcs-fast-export) at once.
-      (Ian Clatworthy)
-
-  API BREAKS:
-
-  TESTING:
-
-    * A large number of tests have been added.
-      (Ian Clatworthy)
-
-  INTERNALS:
-
-    * Refactored ``processors/generic_processor.py`` into a bunch of modules.
-      (Ian Clatworthy)
+In Development
+==============
+
+Compatability Breaks
+--------------------
+
+New Features
+------------
+
+Improvements
+------------
+
+* Updated the bundled version of hg-fast-export to be the latest
+  code (25-May-2009) from http://repo.or.cz/w/fast-export.git.
+  (Ian Clatworthy)
+
+Bug Fixes
+---------
+
+* Fixed inventory delta generation when deleting directories.
+  (Previously the child paths included were relative to the
+  directory when they ought to be relative to the root.)
+  (Ian Clatworthy)
+
+Documentation
+-------------
+
+Testing
+-------
+
+Internals
+---------
+
+
+0.8 22-Jul-2009
+===============
+
+Compatibility Breaks
+--------------------
+
+* ``exporters/bzr-fast-export`` has been replaced with a
+  ``fast-export`` command. Some minor issues have been
+  fixed at the same time: the first commit now goes into
+  refs/heads/master (not refs/head/tmp); there's no
+  checkpoint at the top of the stream; parent commits are
+  now always given lower mark numbers than the commits they
+  are merged into. (Ian Clatworthy)
+
+* The ``fast-import`` command now uses a different mapping of
+  git reference names to bzr branch names. In summary:
+  
+  * ``refs/heads/foo`` is mapped to ``foo``
+  * ``refs/remotes/origin/foo`` is mapped to ``foo.remote``
+  * ``refs/tags/foo`` is mapped to ``foo.tag``
+  * ``*/master`` is mapped to ``trunk``, ``trunk.remote``, etc.
+  * ``*/trunk`` is mapped to ``git-trunk``, ``git-trunk.remote``, etc.
+
+  This new mapping has been introduced so that more natural
+  branch names are used and to enable round-tripping back to git.
+  (Ian Clatworthy)
+
+* The old ``fast-import-filter`` command is now called
+  ``fast-import-query``. ``fast-import-filter`` now
+  really filters the input to produce a fast-import stream
+  based on filtering criteria. See below.
+  (Ian Clatworthy)
+
+* The ``--inv-fulltext`` option is no longer supported. It was
+  only used in experimental mode for old versions of bzrlib so
+  it added more complexity than value. (Ian Clatworthy)
+
+New Features
+------------
+
+* Added ``fast-import-filter`` command for splitting out a
+  subdirectory or bunch of files into their own project. It can
+  also be used to create a new repository without any history
+  for nominated files and directories. This is useful for
+  removing information which is a security risk, huge binary
+  files like ISO images, etc.
+  (Ian Clatworthy)
+
+* Copying of files and symbolic links is now supported.
+  (Ian Clatworthy)
+
+* Initial cut at reset support. (Brian de Alwis, Ian Clatworthy)
+
+Improvements
+------------
+
+* If ``refs/heads/xxx`` and ``refs/remotes/origin/xxx`` are both
+  defined, the latter is now mapped to a bzr branch called
+  ``xxx.remote`` rather than ``remotes--origins--xxx``.
+  (Ian Clatworthy)
+
+* ``bzr fast-import-info`` now handles an unlimited # of parents for a
+  revision. The spec suggests the maximum ought to be 16 but the linux
+  kernel has revisions with more than that.
+  (Ian Clatworthy)
+
+* ``bzr fast-import-info`` now reports on things that may need caching,
+  i.e. merges, rename old paths and copy source paths.
+  (Ian Clatworthy)
+
+* Tag commands with a missing from clause now produce a warning but
+  are otherwise ignored. (Scott James Remnant, Ian Clatworthy)
+
+* The fastimport-id-map file can now have more revisions than the
+  repository. (Scott James Remnant)
+
+* Updated the bundled version of hg-fast-export to be the latest
+  code from http://repo.or.cz/w/fast-export.git. It should now
+  support recent Mercurial releases.
+  (Ian Clatworthy, #318903)
+
+Bug Fixes
+---------
+
+* Fixed a *bad* bug where filecopy commands were being parsed
+  as filerename commands. Repositories generated by previous
+  version of bzr-fast-import where the input stream contained
+  filecopy commands might be missing data (the copy source will
+  no longer be there if it was unchanged since the copy happened)
+  and ought to be regenerated.
+  (Ian Clatworthy)
+
+* Fixed how the per-file graph is generated. The per-file graph
+  may still be less than perfect in the case where a file is only
+  changed in a merge and not the parent, but in the vast majority
+  of cases now, ``bzr check`` should no longer report inconsistent
+  parents. (Ian Clatworthy)
+
+* Fix ``os`` import as needed on Windows.
+  (Ian Clatworthy, esskov, #264988)
+
+* Handle a directory turning into a file and then the children
+  of that directory being deleted.
+  (Ian Clatworthy, #309486)
+
+* Handle an empty email section.
+  (Ian Clatworthy)
+
+* Handle multiple merges within the one merge clause. That's illegal
+  according to the spec but git-fast-export does it.
+  (Ian Clatworthy, #259711)
+
+* Handle names and paths that aren't utf8 encoded. The spec recommends
+  utf8 encoding of these but git-fast-export doesn't always do that.
+  (Ian Clatworthy, #289088)
+
+* Ignore lightweight tags with no from clause rather than abort.
+  (It seems git-fast-export outputs these commands frequently now
+  while it didn't appear to in early versions.)
+  (Ian Clatworthy, edice, #259711)
+
+* Import into rich-root (and subtree) repositories without aborting.
+  (Ian Clatworthy, #300921)
+
+* Recursively delete children when a directory is deleted.
+  (Scott James Remnant)
+
+* The ``deleteall`` command now only tries to delete files in the
+  nominated branch, not all known files. As a consequence,
+  it should now be possible (if it wasn't before) to import
+  multiple Darcs branches (via darcs-fast-export) at once.
+  (Ian Clatworthy)
+
+Testing
+-------
+
+* A large number of tests have been added.
+  (Ian Clatworthy)
+
+Internals
+---------
+
+* Refactored ``processors/generic_processor.py`` into a bunch of modules.
+  (Ian Clatworthy)
 
 
 0.7 09-Feb-2009
----------------
-
-  COMPATIBILITY BREAKS:
-
-    * bzr-fast-export.py renamed to bzr-fast-export.
-      (Jelmer Vernooij)
-
-  IMPROVEMENTS:
-
-    * Add support for the deleteall command.
-      (Miklos Vajna, #284941)
-
-  BUG FIXES:
-
-    * bzr-fast-export now exports rm+mv correctly.
-      (Jonas)
-
-    * Fix recursive rename handling in bzr-fast-export.
-      (Pieter de Bie, #287785)
-
-    * hg-fast-export should use binary mode on Windows.
-      (Alexey Stukalov)
-
-    * setup.py no longer assumes python2.4.
-      (schickb at gmail.com)
-
-    * setup.py support fixed.
-      (Jelmer Vernooij)
-
-    * Update the last-modified revision for a renamed file.
-      (John Arbash Meinel)
+===============
+
+Compatibility Breaks
+--------------------
+
+* bzr-fast-export.py renamed to bzr-fast-export.
+  (Jelmer Vernooij)
+
+Improvements
+------------
+
+* Add support for the deleteall command.
+  (Miklos Vajna, #284941)
+
+Bug Fixes
+---------
+
+* bzr-fast-export now exports rm+mv correctly.
+  (Jonas)
+
+* Fix recursive rename handling in bzr-fast-export.
+  (Pieter de Bie, #287785)
+
+* hg-fast-export should use binary mode on Windows.
+  (Alexey Stukalov)
+
+* setup.py no longer assumes python2.4.
+  (schickb at gmail.com)
+
+* setup.py support fixed.
+  (Jelmer Vernooij)
+
+* Update the last-modified revision for a renamed file.
+  (John Arbash Meinel)
 
 
 0.6 23-Jul-2008
----------------
-
-  FEATURES:
-
-  IMPROVEMENTS:
-
-    * Added NEWS containing Release Notes. (Ian Clatworthy)
-
-    * ``bzr help fastimport`` now provides help that is useful.
-      (Ian Clatworthy)
-
-    * Numerous fixes to ``bzr-fast-export.py`` to improve round-tripping
-      with Git. Added ``--import-marks`` and ``--export-marks`` options
-      to ``fast-import`` as well.
-      (Pieter de Bie)
-
-    * ``svn-fast-export.py`` now supports a regular-expression to specify
-      the branches to export.
-      (Mirko Friedenhagen)
-
-  BUG FIXES:
-
-    * Support the new Repository API added in bzr.dev r3510. The old API
-      will be used for earlier versions of bzr including bzr 1.6beta2 and
-      earlier. (Ian Clatworthy)
-
-  COMPATIBILITY BREAKS:
-
-    * The ``--inv-fulltext`` option is not yet supported when the new
-      Repository API is used to import revisions. The option can be
-      provided but it will be ignored. (Ian Clatworthy)
-
-  API BREAKS:
-
-    * The ``RevisionLoader`` class has been renamed to ``RevisionLoader1``.
-      The ``ExperimentalRevisionLoader`` class has been renamed to
-      ``ImportRevisionLoader1``. New classes called ``RevisionLoader2``
-      and ``ImportRevisionLoader2`` are provided that use the new
-      Repository API. (Ian Clatworthy)
-
-  TESTING:
-
-  INTERNALS:
-
-    * Improved packaging by adding a setup.py file. (Ian Clatworthy)
+===============
+
+Improvements
+------------
+
+* Added NEWS containing Release Notes. (Ian Clatworthy)
+
+* ``bzr help fastimport`` now provides help that is useful.
+  (Ian Clatworthy)
+
+* Numerous fixes to ``bzr-fast-export.py`` to improve round-tripping
+  with Git. Added ``--import-marks`` and ``--export-marks`` options
+  to ``fast-import`` as well.
+  (Pieter de Bie)
+
+* ``svn-fast-export.py`` now supports a regular-expression to specify
+  the branches to export.
+  (Mirko Friedenhagen)
+
+Bug Fixes
+---------
+
+* Support the new Repository API added in bzr.dev r3510. The old API
+  will be used for earlier versions of bzr including bzr 1.6beta2 and
+  earlier. (Ian Clatworthy)
+
+Compatibility Breaks
+--------------------
+
+* The ``--inv-fulltext`` option is not yet supported when the new
+  Repository API is used to import revisions. The option can be
+  provided but it will be ignored. (Ian Clatworthy)
+
+API Breaks
+
+* The ``RevisionLoader`` class has been renamed to ``RevisionLoader1``.
+  The ``ExperimentalRevisionLoader`` class has been renamed to
+  ``ImportRevisionLoader1``. New classes called ``RevisionLoader2``
+  and ``ImportRevisionLoader2`` are provided that use the new
+  Repository API. (Ian Clatworthy)
+
+Internals
+---------
+
+* Improved packaging by adding a setup.py file. (Ian Clatworthy)
 
 
 0.5 02-Jun-2008
----------------
-
-  FEATURES:
-
-    * Version suitable for Bazaar 1.5.
-      (Ian Clatworthy)
+===============
+
+* Version suitable for Bazaar 1.5.
+  (Ian Clatworthy)

=== modified file '__init__.py'
--- a/__init__.py	2009-04-07 06:24:41 +0000
+++ b/__init__.py	2009-07-23 01:55:44 +0000
@@ -45,7 +45,7 @@
 page on Launchpad, https://launchpad.net/bzr-fastimport.
 """
 
-version_info = (0, 8, 0, 'dev', 0)
+version_info = (0, 9, 0, 'dev', 0)
 
 from bzrlib.commands import Command, register_command
 from bzrlib.option import Option, ListOption, RegistryOption

=== modified file 'bzr_commit_handler.py'
--- a/bzr_commit_handler.py	2009-04-08 02:33:08 +0000
+++ b/bzr_commit_handler.py	2009-07-23 06:56:36 +0000
@@ -604,8 +604,9 @@
     def record_delete(self, path, ie):
         self._add_entry((path, None, ie.file_id, None))
         if ie.kind == 'directory':
-            for child_path, entry in \
+            for child_relpath, entry in \
                 self.basis_inventory.iter_entries_by_dir(from_dir=ie):
+                child_path = osutils.pathjoin(path, child_relpath)
                 self._add_entry((child_path, None, entry.file_id, None))
 
     def record_rename(self, old_path, new_path, file_id, old_ie):

=== modified file 'debian/changelog'
--- a/debian/changelog	2009-05-05 18:23:25 +0000
+++ b/debian/changelog	2009-07-24 14:19:33 +0000
@@ -1,3 +1,10 @@
+bzr-fastimport (0.9.0~bzr188-1) unstable; urgency=low
+
+  * New upstream snapshot.
+  * Bump standards version to 3.8.2.
+
+ -- Jelmer Vernooij <jelmer at debian.org>  Fri, 24 Jul 2009 16:19:21 +0200
+
 bzr-fastimport (0.8.0~bzr181-1) unstable; urgency=low
 
   * Move to section vcs.

=== modified file 'debian/control'
--- a/debian/control	2009-03-28 17:51:50 +0000
+++ b/debian/control	2009-07-24 14:19:33 +0000
@@ -6,7 +6,7 @@
 Homepage: https://launchpad.net/bzr-fastimport
 Build-Depends-Indep: bzr (>= 1.0)
 Build-Depends: python-central (>= 0.5), cdbs (>= 0.4.43), debhelper (>= 5.0.37.2), python
-Standards-Version: 3.8.1
+Standards-Version: 3.8.2
 XS-Python-Version: >= 2.4
 Vcs-Bzr: http://bzr.debian.org/pkg-bazaar/bzr-fastimport/unstable/
 

=== modified file 'exporters/hg-fast-export.README'
--- a/exporters/hg-fast-export.README	2008-03-17 18:32:25 +0000
+++ b/exporters/hg-fast-export.README	2009-07-23 04:55:18 +0000
@@ -8,10 +8,12 @@
 #mercurial on freenode. hg-fast-export[1] was integrated into
 bzr-fastimport by Ian Clatworthy with permission from Rocco.
 
+The current maintainer is Frej Drejhammar <frej.drejhammar at gmail.com>.
+
 Usage
 =====
 
-Using hg-fast-export is quite simple:
+Using hg-fast-export is quite simple for a mercurial repository <repo>:
 
   bzr init-repo foo.bzr
   cd foo.bzr
@@ -24,6 +26,10 @@
 one head each. Otherwise commits to the tip of these heads within branch
 will get flattened into merge commits.
 
+The way the hg API and remote access protocol is designed it is not
+possible to use hg-fast-export on remote repositories
+(http/ssh). First clone the repository, then convert it.
+
 Design
 ======
 

=== modified file 'exporters/hg-fast-export.py'
--- a/exporters/hg-fast-export.py	2009-02-12 02:13:10 +0000
+++ b/exporters/hg-fast-export.py	2009-07-23 04:55:18 +0000
@@ -180,8 +180,10 @@
   wr()
 
   pidx1, pidx2 = 0, 1
-  if parents[0] < parents[1]:
-    pidx1, pidx2 = 1, 0
+  if parents[1] > 0:
+    if parents[0] <= 0 or \
+        repo.changelog.node(parents[0]) < repo.changelog.node(parents[1]):
+      pidx1, pidx2 = 1, 0
 
   full_rev=False
   if revision==0: full_rev=True

=== modified file 'exporters/hg2git.py'
--- a/exporters/hg2git.py	2009-02-12 01:55:46 +0000
+++ b/exporters/hg2git.py	2009-07-23 04:55:18 +0000
@@ -26,7 +26,11 @@
   origin_name = name
 
 def setup_repo(url):
-  myui=ui.ui(interactive=False)
+  try:
+    myui=ui.ui(interactive=False)
+  except TypeError:
+    myui=ui.ui()
+    myui.setconfig('ui', 'interactive', 'off')
   return myui,hg.repository(myui,url)
 
 def fixup_user(user,authors):

=== modified file 'parser.py'
--- a/parser.py	2009-04-14 03:47:51 +0000
+++ b/parser.py	2009-07-18 23:09:23 +0000
@@ -88,7 +88,8 @@
 
     # note: delim may be any string but must not contain lf.
     # data_line may contain any data but must not be exactly
-    # delim.
+    # delim. The lf after the final data_line is included in
+    # the data.
   delimited_data ::= 'data' sp '<<' delim lf
     (data_line lf)*
     delim lf;
@@ -234,7 +235,16 @@
 
         :return: the bytes read up to but excluding the terminator.
         """
-        raise NotImplementedError(self.read_until)
+        
+        lines = []
+        term = terminator + '\n'
+        while True:
+            line = self.input.readline()
+            if line == term:
+                break
+            else:
+                lines.append(line)
+        return ''.join(lines)
 
 
 # Regular expression used for parsing. (Note: The spec states that the name

=== modified file 'setup.py'
--- a/setup.py	2009-02-18 08:12:37 +0000
+++ b/setup.py	2009-07-23 01:55:44 +0000
@@ -3,13 +3,13 @@
 
 bzr_plugin_name = 'fastimport'
 
-bzr_plugin_version = (0, 8, 0, 'dev', 0)
+bzr_plugin_version = (0, 9, 0, 'dev', 0)
 bzr_minimum_version = (1, 1, 0)
 bzr_maximum_version = None
 
 if __name__ == '__main__':
     setup(name="fastimport",
-          version="0.8.0dev0",
+          version="0.9.0dev0",
           description="stream-based import into and export from Bazaar.",
           author="Canonical Ltd",
           author_email="bazaar at lists.canonical.com",

=== modified file 'tests/test_parser.py'
--- a/tests/test_parser.py	2009-04-06 20:56:27 +0000
+++ b/tests/test_parser.py	2009-07-18 23:07:37 +0000
@@ -101,6 +101,14 @@
 committer <bugs at bunny.org> now
 data 20
 first commit, empty
+# Test a commit with a heredoc-style (delimited_data) messsage (bug #400960)
+commit refs/heads/master
+mark :4
+author <bugs at bunny.org> now
+committer <bugs at bunny.org> now
+data <<EOF
+Commit with heredoc-style message
+EOF
 """
 
 
@@ -115,7 +123,7 @@
             if cmd.name == 'commit':
                 for fc in cmd.file_iter():
                     result.append(fc)
-        self.assertEqual(len(result), 10)
+        self.assertEqual(len(result), 11)
         cmd1 = result.pop(0)
         self.assertEqual('progress', cmd1.name)
         self.assertEqual('completed', cmd1.message)
@@ -178,6 +186,10 @@
         self.assertEqual('commit', cmd.name)
         self.assertEqual('3', cmd.mark)
         self.assertEqual(None, cmd.from_)
+        cmd = result.pop(0)
+        self.assertEqual('commit', cmd.name)
+        self.assertEqual('4', cmd.mark)
+        self.assertEqual('Commit with heredoc-style message\n', cmd.message)
 
 
 class TestStringParsing(tests.TestCase):



More information about the Pkg-bazaar-commits mailing list