diff options
author | Samuel Bronson <naesten@gmail.com> | 2009-07-23 12:11:29 -0400 |
---|---|---|
committer | Samuel Bronson <naesten@gmail.com> | 2009-07-23 12:11:29 -0400 |
commit | 297332675da5bcc48c1af0cc7ee525d46b362d5b (patch) | |
tree | 9ae3fef50d898e2cbd7dbe2c9250c03062349805 | |
parent | 35433448b6c355cbf08f6da6f3efece5b038c55b (diff) | |
parent | 5b935b4bb76687c93ecf5c3afc2c3e38256a167e (diff) | |
download | bzr-fastimport-297332675da5bcc48c1af0cc7ee525d46b362d5b.tar.gz |
Merge fix for bug #402041 from trunk.
-rw-r--r-- | NEWS | 381 | ||||
-rw-r--r-- | __init__.py | 2 | ||||
-rw-r--r-- | bzr_commit_handler.py | 3 | ||||
-rw-r--r-- | exporters/hg-fast-export.README | 8 | ||||
-rwxr-xr-x | exporters/hg-fast-export.py | 6 | ||||
-rwxr-xr-x | exporters/hg2git.py | 6 | ||||
-rwxr-xr-x | setup.py | 4 |
7 files changed, 231 insertions, 179 deletions
@@ -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) +In Development +============== - FEATURES: +Compatability Breaks +-------------------- - * 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) +New Features +------------ - * Copying of files and symbolic links is now supported. - (Ian Clatworthy) +Improvements +------------ - * Initial cut at reset support. (Brian de Alwis, Ian Clatworthy) +* 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) - IMPROVEMENTS: +Bug Fixes +--------- - * 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) +* 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) - * ``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) +Documentation +------------- - * ``bzr fast-import-info`` now reports on things that may need caching, - i.e. merges, rename old paths and copy source paths. - (Ian Clatworthy) +Testing +------- - * Tag commands with a missing from clause now produce a warning but - are otherwise ignored. (Scott James Remnant, Ian Clatworthy) +Internals +--------- - * 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) +0.8 22-Jul-2009 +=============== - BUG FIXES: +Compatibility Breaks +-------------------- - * 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) +* ``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) - * 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) +* 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. - * Fix ``os`` import as needed on Windows. - (Ian Clatworthy, esskov, #264988) + This new mapping has been introduced so that more natural + branch names are used and to enable round-tripping back to git. + (Ian Clatworthy) - * Handle a directory turning into a file and then the children - of that directory being deleted. - (Ian Clatworthy, #309486) +* 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) - * Handle an empty email section. - (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) - * Handle multiple merges within the one merge clause. That's illegal - according to the spec but git-fast-export does it. - (Ian Clatworthy, #259711) +New Features +------------ - * 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) +* 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) - * 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) +* Copying of files and symbolic links is now supported. + (Ian Clatworthy) - * Import into rich-root (and subtree) repositories without aborting. - (Ian Clatworthy, #300921) +* Initial cut at reset support. (Brian de Alwis, Ian Clatworthy) - * Recursively delete children when a directory is deleted. - (Scott James Remnant) +Improvements +------------ - * 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) +* 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) - API BREAKS: +* ``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) - TESTING: +* ``bzr fast-import-info`` now reports on things that may need caching, + i.e. merges, rename old paths and copy source paths. + (Ian Clatworthy) - * A large number of tests have been added. - (Ian Clatworthy) +* Tag commands with a missing from clause now produce a warning but + are otherwise ignored. (Scott James Remnant, Ian Clatworthy) - INTERNALS: +* The fastimport-id-map file can now have more revisions than the + repository. (Scott James Remnant) - * Refactored ``processors/generic_processor.py`` into a bunch of modules. - (Ian Clatworthy) +* 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 +--------- -0.7 09-Feb-2009 ---------------- +* 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) - COMPATIBILITY BREAKS: +* 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) - * bzr-fast-export.py renamed to bzr-fast-export. - (Jelmer Vernooij) +* 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) - IMPROVEMENTS: +* 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) - * Add support for the deleteall command. - (Miklos Vajna, #284941) +* 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) - BUG FIXES: +* Import into rich-root (and subtree) repositories without aborting. + (Ian Clatworthy, #300921) - * bzr-fast-export now exports rm+mv correctly. - (Jonas) +* Recursively delete children when a directory is deleted. + (Scott James Remnant) - * Fix recursive rename handling in bzr-fast-export. - (Pieter de Bie, #287785) +* 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) - * hg-fast-export should use binary mode on Windows. - (Alexey Stukalov) +Testing +------- - * setup.py no longer assumes python2.4. - (schickb@gmail.com) +* A large number of tests have been added. + (Ian Clatworthy) - * setup.py support fixed. - (Jelmer Vernooij) +Internals +--------- - * Update the last-modified revision for a renamed file. - (John Arbash Meinel) +* Refactored ``processors/generic_processor.py`` into a bunch of modules. + (Ian Clatworthy) -0.6 23-Jul-2008 ---------------- +0.7 09-Feb-2009 +=============== + +Compatibility Breaks +-------------------- - FEATURES: +* bzr-fast-export.py renamed to bzr-fast-export. + (Jelmer Vernooij) - IMPROVEMENTS: +Improvements +------------ - * Added NEWS containing Release Notes. (Ian Clatworthy) +* Add support for the deleteall command. + (Miklos Vajna, #284941) - * ``bzr help fastimport`` now provides help that is useful. - (Ian Clatworthy) +Bug Fixes +--------- - * 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) +* bzr-fast-export now exports rm+mv correctly. + (Jonas) - * ``svn-fast-export.py`` now supports a regular-expression to specify - the branches to export. - (Mirko Friedenhagen) +* Fix recursive rename handling in bzr-fast-export. + (Pieter de Bie, #287785) - BUG FIXES: +* hg-fast-export should use binary mode on Windows. + (Alexey Stukalov) - * 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) +* setup.py no longer assumes python2.4. + (schickb@gmail.com) - COMPATIBILITY BREAKS: +* setup.py support fixed. + (Jelmer Vernooij) - * 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) +* Update the last-modified revision for a renamed file. + (John Arbash Meinel) - 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) +0.6 23-Jul-2008 +=============== - TESTING: +Improvements +------------ - INTERNALS: +* Added NEWS containing Release Notes. (Ian Clatworthy) - * Improved packaging by adding a setup.py file. (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) -0.5 02-Jun-2008 ---------------- +* ``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) - FEATURES: +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 +=============== - * Version suitable for Bazaar 1.5. - (Ian Clatworthy) +* Version suitable for Bazaar 1.5. + (Ian Clatworthy) diff --git a/__init__.py b/__init__.py index 0620316..38e4747 100644 --- a/__init__.py +++ b/__init__.py @@ -45,7 +45,7 @@ To report bugs or publish enhancements, visit the bzr-fastimport project 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 diff --git a/bzr_commit_handler.py b/bzr_commit_handler.py index a71a12c..339bc72 100644 --- a/bzr_commit_handler.py +++ b/bzr_commit_handler.py @@ -604,8 +604,9 @@ class InventoryDeltaCommitHandler(GenericCommitHandler): 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): diff --git a/exporters/hg-fast-export.README b/exporters/hg-fast-export.README index 85ec8ab..a5999de 100644 --- a/exporters/hg-fast-export.README +++ b/exporters/hg-fast-export.README @@ -8,10 +8,12 @@ by Rocco Rutte <pdmef@gmx.net> with hints and help from the git list and #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@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 @@ hg-fast-import supports multiple branches but only named branches with exactly 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 ====== diff --git a/exporters/hg-fast-export.py b/exporters/hg-fast-export.py index 590a28b..9d0e2a2 100755 --- a/exporters/hg-fast-export.py +++ b/exporters/hg-fast-export.py @@ -180,8 +180,10 @@ def export_commit(ui,repo,revision,marks,mapping,heads,last,max,count,authors,so 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 diff --git a/exporters/hg2git.py b/exporters/hg2git.py index fd8b632..3c0d1e3 100755 --- a/exporters/hg2git.py +++ b/exporters/hg2git.py @@ -26,7 +26,11 @@ def set_origin_name(name): 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): @@ -3,13 +3,13 @@ from distutils.core import setup 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@lists.canonical.com", |