[Pkg-bazaar-commits] ./bzr-rebase/unstable r56: New upstream release.

Jelmer Vernooij jelmer at samba.org
Wed May 20 16:09:08 UTC 2009


------------------------------------------------------------
revno: 56
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: unstable
timestamp: Wed 2009-05-20 17:51:50 +0200
message:
  New upstream release.
added:
  test_upgrade.py
  upgrade.py
modified:
  Makefile
  NEWS
  __init__.py
  commands.py
  debian/changelog
  debian/control
  rebase.py
  setup.py
  test_blackbox.py
  test_rebase.py
    ------------------------------------------------------------
    revno: 24.1.110
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Tue 2009-03-10 14:23:49 +0100
    message:
      Start on 0.4.5.
    modified:
      NEWS
      __init__.py
      setup.py
    ------------------------------------------------------------
    revno: 24.1.111
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Tue 2009-03-17 07:23:15 +0100
    message:
      Remove use of deprecated Revision.get_apparent_author().
    modified:
      NEWS
      __init__.py
      rebase.py
    ------------------------------------------------------------
    revno: 24.1.112
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Tue 2009-03-31 19:49:28 +0200
    message:
      Avoid setting authors property twice.
    modified:
      rebase.py
    ------------------------------------------------------------
    revno: 24.1.113
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Wed 2009-04-29 17:39:25 +0200
    message:
      Claim support for 1.15.
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 24.1.114
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Sat 2009-05-02 15:41:46 +0200
    message:
      Support replaying in empty branch.
    modified:
      rebase.py
    ------------------------------------------------------------
    revno: 24.1.115
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: foreign
    timestamp: Mon 2009-05-04 19:03:04 +0200
    message:
      Import foreign-mapping-upgrade.
    added:
      upgrade.py
    modified:
      __init__.py
      commands.py
        ------------------------------------------------------------
        revno: 0.1.1
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2008-08-27 21:34:29 +0200
        message:
          Import utility functions for foreign branches.
        added:
          foreign.py
        ------------------------------------------------------------
        revno: 0.1.2
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2008-08-27 21:36:31 +0200
        message:
          Rename to __init__.py.
        renamed:
          foreign.py => __init__.py
        ------------------------------------------------------------
        revno: 0.1.3
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2008-08-27 21:43:01 +0200
        message:
          Fix import.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.4
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Fri 2008-08-29 13:45:07 +0200
        message:
          Import TODO.
        added:
          TODO
        ------------------------------------------------------------
        revno: 0.1.5
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Fri 2008-08-29 16:56:37 +0200
        message:
          Import virtual versionedfiles code.
        added:
          .bzrignore
          test_versionedfiles.py
          versionedfiles.py
        ------------------------------------------------------------
        revno: 0.1.6
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Fri 2008-08-29 17:05:47 +0200
        message:
          Import FakeControlFiles.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.7
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Fri 2008-08-29 17:16:27 +0200
        message:
          Import dpush.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.8
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Fri 2008-08-29 17:17:56 +0200
        message:
          Remove references to svn.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.9
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Fri 2008-08-29 17:51:57 +0200
        message:
          Add abstract functions for converting revision ids between bzr and foreign vcses.
        modified:
          TODO
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.10
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Fri 2008-08-29 18:17:58 +0200
        message:
          Implement dpush using dpull function on Branch.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.11
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sat 2008-08-30 04:31:10 +0200
        message:
          Fix dpush.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.12
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Tue 2008-09-09 14:41:34 +0200
        message:
          Import upgrade code for upgrading mappings.
        added:
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.13
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Tue 2008-09-09 14:48:35 +0200
        message:
          Fix syntax errors.
        modified:
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.14
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Tue 2008-09-09 14:59:14 +0200
        message:
          Fix upgrade_branch.
        modified:
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.15
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Tue 2008-09-09 17:44:18 +0200
        message:
          Add test_suite function.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.16
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Mon 2008-11-10 17:14:20 +0100
        message:
          Import fixes from bzr-svn.
        modified:
          __init__.py
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.17
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Mon 2008-11-10 17:16:50 +0100
        message:
          Merge trunk.
            ------------------------------------------------------------
            revno: 0.2.1
            committer: Jelmer Vernooij <jelmer at samba.org>
            branch nick: trunk
            timestamp: Tue 2008-09-30 22:31:34 +0200
            message:
              Add ForeignBranch class, make dpush fallback to regular push.
            modified:
              __init__.py
            ------------------------------------------------------------
            revno: 0.2.2
            committer: Jelmer Vernooij <jelmer at samba.org>
            branch nick: trunk
            timestamp: Wed 2008-11-05 21:14:28 +0100
            message:
              Import escape commit message function.
            modified:
              __init__.py
        ------------------------------------------------------------
        revno: 0.1.18
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2008-11-12 12:19:19 +0100
        message:
          Add docstrings.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.19
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2008-11-12 15:36:10 +0100
        message:
          import bzr-svn improvements.
        modified:
          __init__.py
          upgrade.py
          versionedfiles.py
        ------------------------------------------------------------
        revno: 0.1.20
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2008-11-12 19:16:18 +0100
        message:
          Merge bzr-svn improvements.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.21
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2008-11-19 14:10:27 +0100
        message:
          Only register foreign property show function once.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.22
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Tue 2008-11-25 01:33:32 +0100
        message:
          Merge improvements from bzr-svn.
        modified:
          __init__.py
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.23
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Tue 2008-11-25 02:03:00 +0100
        message:
          Add more docstrings.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.24
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Tue 2008-11-25 04:16:20 +0100
        message:
          Remove elements pending to be included in bzrlib.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.25
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Tue 2008-11-25 04:55:53 +0100
        message:
          Fix function names.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.26
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Fri 2008-12-26 14:43:41 +0100
        message:
          Remove ForeignRepository class now in bzr.dev
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.27
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sat 2008-12-27 17:20:48 +0100
        message:
          Make sure target branch is unlocked.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.28
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sat 2008-12-27 17:27:10 +0100
        message:
          merge trunk.
            ------------------------------------------------------------
            revno: 0.3.1
            committer: Jelmer Vernooij <jelmer at samba.org>
            branch nick: trunk
            timestamp: Fri 2008-11-21 15:29:55 +0100
            message:
              Add ForeignRepository.
            modified:
              __init__.py
            ------------------------------------------------------------
            revno: 0.3.2
            committer: Jelmer Vernooij <jelmer at samba.org>
            branch nick: trunk
            timestamp: Fri 2008-11-28 14:12:43 +0100
            message:
              Merge upstream.
            modified:
              __init__.py
              upgrade.py
            ------------------------------------------------------------
            revno: 0.3.3
            committer: Jelmer Vernooij <jelmer at samba.org>
            branch nick: trunk
            timestamp: Thu 2008-12-25 13:20:09 +0000
            message:
              Remove ForeignRepository (now in bzr.dev).
            modified:
              __init__.py
        ------------------------------------------------------------
        revno: 0.1.29
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sat 2008-12-27 17:35:25 +0100
        message:
          Fix updating of file ids.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.30
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Thu 2009-01-22 01:29:31 +0100
        message:
          Properly return None if a key wasn't found.
        modified:
          versionedfiles.py
        ------------------------------------------------------------
        revno: 0.1.31
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sat 2009-01-31 16:59:10 +0100
        message:
          Remove unused imports.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.32
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sat 2009-01-31 17:16:23 +0100
        message:
          Don't rely on isinstance when there are multiple copies of a type around.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.33
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sun 2009-02-01 04:00:40 +0100
        message:
          Import simplifications for upgrade.
        modified:
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.34
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sun 2009-02-01 05:08:46 +0100
        message:
          s/get_revision/get_inventory.
        modified:
          __init__.py
          test_versionedfiles.py
          versionedfiles.py
        ------------------------------------------------------------
        revno: 0.1.35
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sun 2009-02-01 05:17:31 +0100
        message:
          Fix empty dpush case.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.36
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sun 2009-02-01 05:56:23 +0100
        message:
          Just replace all file ids, rather than worrying about unchanged children of changed directories.
        modified:
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.37
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sun 2009-02-08 20:20:14 +0100
        message:
          Import foreign-mapping-upgrade command, fixes for bzr-svn.
        modified:
          __init__.py
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.38
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sun 2009-02-08 20:27:00 +0100
        message:
          Support dpush --idmap-file.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.39
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Mon 2009-02-09 00:11:41 +0100
        message:
          Merge upstream.
            ------------------------------------------------------------
            revno: 0.4.1
            committer: Jelmer Vernooij <jelmer at samba.org>
            branch nick: trunk
            timestamp: Mon 2009-02-02 16:48:05 +0100
            message:
              Import foreign-mapping-upgrade.
            modified:
              __init__.py
              upgrade.py
        ------------------------------------------------------------
        revno: 0.1.40
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sun 2009-02-15 02:32:41 +0100
        message:
          Don't upgrade tags to revisions in branch ancestry.
        modified:
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.41
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sun 2009-02-15 02:34:16 +0100
        message:
          Fix typo.
        modified:
          upgrade.py
        ------------------------------------------------------------
        revno: 0.1.42
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2009-02-18 23:34:29 +0100
        message:
          Fix one-line summary.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.43
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sat 2009-03-14 19:17:35 +0100
        message:
          Add keys to virtual VersionedFiles.
        modified:
          versionedfiles.py
        ------------------------------------------------------------
        revno: 0.1.44
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Thu 2009-03-19 17:43:56 +0100
        message:
          Fix formatting.
        modified:
          __init__.py
          test_versionedfiles.py
          upgrade.py
          versionedfiles.py
        ------------------------------------------------------------
        revno: 0.1.45
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sun 2009-03-22 00:30:09 +0100
        message:
          Remove dpush command (should be in bzr itself, or if that doesn't make it in a separate plugin).
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.46
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2009-04-01 02:40:12 +0200
        message:
          Run TestCase.setUp().
        modified:
          test_versionedfiles.py
        ------------------------------------------------------------
        revno: 0.1.47
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Thu 2009-04-02 15:59:17 +0200
        message:
          Remove escape_commit_message, now in bzrlib.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.48
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Sat 2009-04-04 16:02:03 +0200
        message:
          Remove escape_commit_message function that is now in bzrlib.
        ------------------------------------------------------------
        revno: 0.1.49
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Fri 2009-04-10 00:26:15 +0200
        message:
          Remove ForeignBranch, now in bzrlib.
        modified:
          __init__.py
        ------------------------------------------------------------
        revno: 0.1.50
        committer: Jelmer Vernooij <jelmer at samba.org>
        branch nick: trunk
        timestamp: Wed 2009-04-29 19:05:01 +0200
        message:
          Remove FakeControlFiles, it's no longer used.
        modified:
          __init__.py
    ------------------------------------------------------------
    revno: 24.1.116
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: foreign
    timestamp: Mon 2009-05-04 19:04:50 +0200
    message:
      Remove checks for rebase.
    modified:
      upgrade.py
    ------------------------------------------------------------
    revno: 24.1.117
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: foreign
    timestamp: Mon 2009-05-04 19:12:31 +0200
    message:
      Use utility functions from bzrlib.foreign.
    modified:
      upgrade.py
    ------------------------------------------------------------
    revno: 24.1.118
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: foreign
    timestamp: Mon 2009-05-04 19:22:13 +0200
    message:
      mark as compatible with 1.14.0 only.
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 24.1.119
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: foreign
    timestamp: Mon 2009-05-04 19:29:47 +0200
    message:
      Remove unnecessary imports.
    modified:
      commands.py
    ------------------------------------------------------------
    revno: 24.1.120
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Mon 2009-05-04 20:05:12 +0200
    message:
      Use iteritems
    modified:
      upgrade.py
    ------------------------------------------------------------
    revno: 24.1.121
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Fri 2009-05-08 17:02:45 +0200
    message:
      Fix test.
    modified:
      __init__.py
      test_rebase.py
    ------------------------------------------------------------
    revno: 24.1.122
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Sat 2009-05-09 00:47:27 +0200
    message:
      Actually add upgrade tests.
    added:
      test_upgrade.py
    ------------------------------------------------------------
    revno: 24.1.123
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Wed 2009-05-13 17:06:43 +0200
    message:
      Fix tests against bzr.dev.
    modified:
      test_blackbox.py
    ------------------------------------------------------------
    revno: 24.1.124
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Wed 2009-05-13 18:53:23 +0200
    message:
      Support existing BZR_PLUGIN_PATH, add coverage target.
    modified:
      Makefile
    ------------------------------------------------------------
    revno: 24.1.125
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Wed 2009-05-20 17:47:23 +0200
    message:
      Release 0.5.0.
    modified:
      NEWS
      __init__.py
      setup.py
-------------- next part --------------
=== modified file 'Makefile'
--- a/Makefile	2008-08-03 08:36:33 +0000
+++ b/Makefile	2009-05-13 16:53:23 +0000
@@ -31,16 +31,19 @@
 	ln -sf .. $@
 
 check:: $(TMP_PLUGINS_DIR)/rebase/
-	BZR_PLUGIN_PATH=$(TMP_PLUGINS_DIR) $(DEBUGGER) $(PYTHON) $(BZR) selftest $(TEST_OPTIONS) --starting-with=bzrlib.plugins.rebase $(TESTS)
+	BZR_PLUGIN_PATH=$(TMP_PLUGINS_DIR):$(BZR_PLUGIN_PATH) $(DEBUGGER) $(PYTHON) $(BZR) $(BZR_OPTIONS) selftest $(TEST_OPTIONS) --starting-with=bzrlib.plugins.rebase $(TESTS)
 
 check-verbose::
 	$(MAKE) check TEST_OPTIONS=-v
 
+coverage::
+	$(MAKE) check BZR_OPTIONS="--coverage coverage"
+
 check-one::
 	$(MAKE) check TEST_OPTIONS=--one
 
 show-plugins::
-	BZR_PLUGIN_PATH=$(TMP_PLUGINS_DIR) $(BZR) plugins
+	BZR_PLUGIN_PATH=$(TMP_PLUGINS_DIR):$(BZR_PLUGIN_PATH) $(BZR) plugins
 
 lint::
 	$(PYLINT) -f parseable *.py */*.py

=== modified file 'NEWS'
--- a/NEWS	2009-03-10 13:23:00 +0000
+++ b/NEWS	2009-05-20 15:47:23 +0000
@@ -1,3 +1,13 @@
+0.5.0	2009-05-20
+
+ BUG FIXES
+
+  * Remove use of deprecated Revision.get_apparent_author().
+
+ FEATURES
+
+  * Import "bzr foreign-mapping-upgrade" command from bzr-foreign.
+
 0.4.4	2009-03-10
 
  BUG FIXES

=== modified file '__init__.py'
--- a/__init__.py	2009-03-10 13:23:00 +0000
+++ b/__init__.py	2009-05-20 15:47:23 +0000
@@ -25,7 +25,7 @@
 import bzrlib.api
 from bzrlib.commands import plugin_cmds
 
-version_info = (0, 4, 4, 'final', 0)
+version_info = (0, 5, 0, 'final', 0)
 if version_info[3] == 'final':
     version_string = '%d.%d.%d' % version_info[:3]
 else:
@@ -33,8 +33,7 @@
 __version__ = version_string
 __author__ = 'Jelmer Vernooij <jelmer at samba.org>'
 
-COMPATIBLE_BZR_VERSIONS = [(1, 6, 0), (1, 7, 0), (1, 8, 0), (1, 9, 0),
-                           (1, 10, 0), (1, 11, 0), (1, 12, 0), (1, 13, 0)]
+COMPATIBLE_BZR_VERSIONS = [(1, 14, 0), (1, 15, 0)]
 
 bzrlib.api.require_any_api(bzrlib, COMPATIBLE_BZR_VERSIONS)
 
@@ -43,6 +42,9 @@
     plugin_cmds.register_lazy("cmd_%s" % cmd, [], 
         "bzrlib.plugins.rebase.commands")
 
+plugin_cmds.register_lazy('cmd_foreign_mapping_upgrade', ['svn-upgrade'], 
+                          'bzrlib.plugins.rebase.commands')
+
 
 def test_suite():
     """Determine the testsuite for bzr-rebase."""
@@ -51,7 +53,11 @@
 
     loader = TestUtil.TestLoader()
     suite = TestSuite()
-    testmod_names = ['test_blackbox', 'test_rebase', 'test_maptree']
+    testmod_names = [
+        'test_blackbox',
+        'test_maptree',
+        'test_rebase',
+        'test_upgrade']
     suite.addTest(loader.loadTestsFromModuleNames(
                               ["%s.%s" % (__name__, i) for i in testmod_names]))
 

=== modified file 'commands.py'
--- a/commands.py	2009-02-21 02:01:58 +0000
+++ b/commands.py	2009-05-04 17:29:47 +0000
@@ -16,12 +16,26 @@
 
 """Bazaar command-line subcommands."""
 
-from bzrlib.commands import Command, display_command
-from bzrlib.errors import (BzrCommandError, ConflictsInTree, NoSuchFile, 
-                           UnrelatedBranches, NoSuchRevision, 
-                           UncommittedChanges)
-from bzrlib.trace import info, warning
-from bzrlib.option import Option
+from bzrlib.commands import (
+    Command,
+    display_command,
+    )
+from bzrlib.errors import (
+    BzrCommandError,
+    ConflictsInTree,
+    NoSuchFile,
+    NoSuchRevision,
+    NoWorkingTree,
+    UncommittedChanges,
+    UnrelatedBranches,
+    )
+from bzrlib.option import (
+    Option,
+    )
+from bzrlib.trace import (
+    info,
+    warning,
+    )
 
 class cmd_rebase(Command):
     """Re-base a branch.
@@ -331,3 +345,78 @@
         finally:
             pb.finished()
             wt.unlock()
+
+
+class cmd_foreign_mapping_upgrade(Command):
+    """Upgrade revisions mapped from a foreign version control system.
+    
+    This will change the identity of revisions whose parents 
+    were mapped from revisions in the other version control system.
+
+    You are recommended to run "bzr check" in the local repository 
+    after running this command.
+    """
+    aliases = ['svn-upgrade']
+    takes_args = ['from_repository?']
+    takes_options = ['verbose', 
+            Option("idmap-file", help="Write map with old and new revision ids.", type=str)]
+
+    def run(self, from_repository=None, verbose=False, idmap_file=None):
+        from bzrlib import (
+            urlutils,
+            )
+        from bzrlib.branch import Branch
+        from bzrlib.repository import Repository
+        from bzrlib.workingtree import WorkingTree
+        from bzrlib.plugins.rebase.upgrade import (
+            upgrade_branch,
+            upgrade_workingtree,
+            )
+        try:
+            wt_to = WorkingTree.open(".")
+            branch_to = wt_to.branch
+        except NoWorkingTree:
+            wt_to = None
+            branch_to = Branch.open(".")
+
+        stored_loc = branch_to.get_parent()
+        if from_repository is None:
+            if stored_loc is None:
+                raise BzrCommandError("No pull location known or"
+                                             " specified.")
+            else:
+                display_url = urlutils.unescape_for_display(stored_loc,
+                        self.outf.encoding)
+                self.outf.write("Using saved location: %s\n" % display_url)
+                from_repository = Branch.open(stored_loc).repository
+        else:
+            from_repository = Repository.open(from_repository)
+
+        vcs = getattr(from_repository, "vcs", None)
+        if vcs is None:
+            raise BzrCommandError("Repository at %s is not a foreign repository.a" % from_repository.base)
+
+        new_mapping = from_repository.get_mapping()
+
+        if wt_to is not None:
+            renames = upgrade_workingtree(wt_to, from_repository, 
+                                          new_mapping=new_mapping,
+                                          allow_changes=True, verbose=verbose)
+        else:
+            renames = upgrade_branch(branch_to, from_repository, 
+                                     new_mapping=new_mapping,
+                                     allow_changes=True, verbose=verbose)
+
+        if renames == {}:
+            info("Nothing to do.")
+
+        if idmap_file is not None:
+            f = open(idmap_file, 'w')
+            try:
+                for oldid, newid in renames.iteritems():
+                    f.write("%s\t%s\n" % (oldid, newid))
+            finally:
+                f.close()
+
+        if wt_to is not None:
+            wt_to.set_last_revision(branch_to.last_revision())

=== modified file 'debian/changelog'
--- a/debian/changelog	2009-05-05 19:10:00 +0000
+++ b/debian/changelog	2009-05-20 15:51:50 +0000
@@ -1,10 +1,11 @@
-bzr-rebase (0.4.4-2) UNRELEASED; urgency=low
+bzr-rebase (0.5.0-1) unstable; urgency=low
 
   * Move to section vcs.
   * Bump standards version to 3.8.1.
   * Bump debhelper compat version to 5.
+  * New upstream release.
 
- -- Jelmer Vernooij <jelmer at debian.org>  Tue, 05 May 2009 21:09:45 +0200
+ -- Jelmer Vernooij <jelmer at debian.org>  Wed, 20 May 2009 17:44:39 +0200
 
 bzr-rebase (0.4.4-1) unstable; urgency=low
 

=== modified file 'debian/control'
--- a/debian/control	2009-03-19 17:04:35 +0000
+++ b/debian/control	2009-05-20 15:51:50 +0000
@@ -4,7 +4,7 @@
 Maintainer: Debian Bazaar Maintainers <pkg-bazaar-maint at lists.alioth.debian.org>
 Uploaders: Jelmer Vernooij <jelmer at debian.org>
 Homepage: http://bazaar-vcs.org/Rebase
-Build-Depends-Indep: bzr (>= 1.6~)
+Build-Depends-Indep: bzr (>= 1.14~)
 Build-Depends: python-central (>= 0.5), cdbs (>= 0.4.43), debhelper (>= 5.0.37.2), python
 Standards-Version: 3.8.1
 XS-Python-Version: >= 2.4
@@ -12,7 +12,7 @@
 
 Package: bzr-rebase
 Architecture: all
-Depends: bzr (>= 1.6~), ${python:Depends}, ${misc:Depends}
+Depends: bzr (>= 1.14~), ${python:Depends}, ${misc:Depends}
 Enhances: bzr
 XB-Python-Version: ${python:Versions}
 Description: Rebase plugin for Bazaar

=== modified file 'rebase.py'
--- a/rebase.py	2009-02-21 02:01:58 +0000
+++ b/rebase.py	2009-05-02 13:41:46 +0000
@@ -394,12 +394,21 @@
     revprops = dict(oldrev.properties)
     revprops[REVPROP_REBASE_OF] = oldrev.revision_id
     committer = wt.branch.get_config().username()
-    author = oldrev.get_apparent_author()
-    if author == committer or 'author' in revprops:
-        author = None
+    authors = oldrev.get_apparent_authors()
+    if oldrev.committer == committer:
+        # No need to explicitly record the authors if the original 
+        # committer is rebasing.
+        if [oldrev.committer] == authors:
+            authors = None
+    else:
+        authors.append(oldrev.committer)
+    if 'author' in revprops:
+        del revprops['author']
+    if 'authors' in revprops:
+        del revprops['authors']
     wt.commit(message=oldrev.message, timestamp=oldrev.timestamp, 
               timezone=oldrev.timezone, revprops=revprops, rev_id=newrevid,
-              committer=committer, author=author)
+              committer=committer, authors=authors)
     write_active_rebase_revid(wt, None)
 
 
@@ -522,7 +531,7 @@
     newtree = wt.branch.repository.revision_tree(newparents[0])
     delta = wt.changes_from(newtree)
     wt.branch.generate_revision_history(newparents[0])
-    wt.set_parent_ids(newparents[:1])
+    wt.set_parent_ids([r for r in newparents[:1] if r != NULL_REVISION])
     for (f, _, _) in delta.added:
         abs_path = wt.abspath(f)
         if osutils.lexists(abs_path):
@@ -532,7 +541,7 @@
                 os.unlink(abs_path)
     wt.revert(None, old_tree=newtree, backups=False)
     assert not wt.changes_from(wt.basis_tree()).has_changed(), "Rev changed"
-    wt.set_parent_ids(newparents)
+    wt.set_parent_ids([r for r in newparents if r != NULL_REVISION])
 
 
 class ReplaySnapshotError(BzrError):

=== modified file 'setup.py'
--- a/setup.py	2009-02-15 00:53:11 +0000
+++ b/setup.py	2009-05-20 15:47:23 +0000
@@ -5,7 +5,7 @@
 setup(name='bzr-rebase',
       description='Rebase plugin for Bazaar',
       keywords='plugin bzr rebase',
-      version='0.4.4',
+      version='0.5.0',
       url='http://bazaar-vcs.org/Rebase',
       download_url='http://bazaar-vcs.org/Rebase',
       license='GPLv3 or later',

=== modified file 'test_blackbox.py'
--- a/test_blackbox.py	2009-02-21 02:01:58 +0000
+++ b/test_blackbox.py	2009-05-13 15:06:43 +0000
@@ -61,7 +61,8 @@
                           Branch.open("../main").revision_history())
 
     def test_no_pending_merges(self):
-        self.run_bzr_error(['bzr: ERROR: No pending merges present.\n'], 'rebase --pending-merges')
+        self.run_bzr_error(['bzr: ERROR: No pending merges present.\n'], 
+                           ['rebase', '--pending-merges'])
 
     def test_pending_merges(self):
         os.chdir('..')
@@ -151,9 +152,8 @@
         self.make_file('hello', "other data")
         self.run_bzr('commit -m this')
         self.run_bzr_error([
-            'Text conflict in hello',
-            'bzr: ERROR: A conflict occurred replaying a commit. Resolve the conflict and run \'bzr rebase-continue\' or run \'bzr rebase-abort\'.',
-            ], 'rebase ../main')
+            'Text conflict in hello\n1 conflicts encountered.\nbzr: ERROR: A conflict occurred replaying a commit. Resolve the conflict and run \'bzr rebase-continue\' or run \'bzr rebase-abort\'.',
+            ], ['rebase', '../main'])
 
     def test_conflicting_abort(self):
         self.make_file('hello', '42')
@@ -162,7 +162,7 @@
         self.make_file('hello', "other data")
         self.run_bzr('commit -m this')
         old_log = self.run_bzr('log')[0]
-        self.run_bzr_error('Text conflict in hello\nbzr: ERROR: A conflict occurred replaying a commit. Resolve the conflict and run \'bzr rebase-continue\' or run \'bzr rebase-abort\'.\n', 'rebase ../main')
+        self.run_bzr_error(['Text conflict in hello\n1 conflicts encountered.\nbzr: ERROR: A conflict occurred replaying a commit. Resolve the conflict and run \'bzr rebase-continue\' or run \'bzr rebase-abort\'.\n'], ['rebase', '../main'])
         self.check_output('', 'rebase-abort')
         self.check_output(old_log, 'log')
 
@@ -172,22 +172,22 @@
         os.chdir('../feature')
         self.make_file('hello', "other data")
         self.run_bzr('commit -m this')
-        self.run_bzr_error('Text conflict in hello\nbzr: ERROR: A conflict occurred replaying a commit. Resolve the conflict and run \'bzr rebase-continue\' or run \'bzr rebase-abort\'.\n', 'rebase ../main')
+        self.run_bzr_error(['Text conflict in hello\n1 conflicts encountered.\nbzr: ERROR: A conflict occurred replaying a commit. Resolve the conflict and run \'bzr rebase-continue\' or run \'bzr rebase-abort\'.\n'], ['rebase', '../main'])
         self.run_bzr('resolved hello')
         self.check_output('', 'rebase-continue')
         self.check_output('3\n', 'revno')
 
     def test_continue_nothing(self):
-        self.run_bzr_error('bzr: ERROR: No rebase to continue', 
-                           'rebase-continue')
+        self.run_bzr_error(['bzr: ERROR: No rebase to continue'], 
+                           ['rebase-continue'])
 
     def test_abort_nothing(self):
-        self.run_bzr_error('bzr: ERROR: No rebase to abort', 
-                           'rebase-abort')
+        self.run_bzr_error(['bzr: ERROR: No rebase to abort'], 
+                           ['rebase-abort'])
 
     def test_todo_nothing(self):
-        self.run_bzr_error('bzr: ERROR: No rebase in progress', 
-                           'rebase-todo')
+        self.run_bzr_error(['bzr: ERROR: No rebase in progress'], 
+                           ['rebase-todo'])
 
     def test_onto(self):
         self.make_file('hello', '42')
@@ -212,7 +212,7 @@
         self.run_bzr('add')
         self.run_bzr('commit -m x')
         self.run_bzr_error(['bzr: ERROR: Branches have no common ancestor, and no merge base.*'],
-                           'rebase ../main')
+                           ['rebase', '../main'])
 
     def test_verbose(self):
         self.make_file('hello', '42')

=== modified file 'test_rebase.py'
--- a/test_rebase.py	2009-02-21 02:01:58 +0000
+++ b/test_rebase.py	2009-05-08 15:02:45 +0000
@@ -35,6 +35,7 @@
 
 
 class RebasePlanReadWriterTests(TestCase):
+
     def test_simple_marshall_rebase_plan(self):
         self.assertEqualDiff(
 """# Bazaar rebase plan 1
@@ -60,6 +61,7 @@
 
 
 class ConversionTests(TestCaseWithTransport):
+
     def test_simple(self):
         wt = self.make_branch_and_tree('.')
         b = wt.branch
@@ -239,6 +241,7 @@
  
 
 class PlanFileTests(TestCaseWithTransport):
+
    def test_rebase_plan_exists_false(self):
         wt = self.make_branch_and_tree('.')
         self.assertFalse(rebase_plan_exists(wt))
@@ -297,6 +300,7 @@
 
 
 class CurrentRevidFileTests(TestCaseWithTransport):
+
     def test_read_nonexistant(self):
         wt = self.make_branch_and_tree('.')
         self.assertIs(None, read_active_rebase_revid(wt))
@@ -323,6 +327,7 @@
 
 
 class RebaseTodoTests(TestCase):
+
     def test_done(self):
         class Repository:
             def has_revision(self, revid):
@@ -655,7 +660,9 @@
 
 
 class ReplayDetermineBaseTests(TestCase):
+
     def setUp(self):
+        TestCase.setUp(self)
         self.graph = Graph(self)
 
     def get_parent_map(self, keys):

=== added file 'test_upgrade.py'
--- a/test_upgrade.py	1970-01-01 00:00:00 +0000
+++ b/test_upgrade.py	2009-05-08 22:47:27 +0000
@@ -0,0 +1,51 @@
+# Copyright (C) 2007-2009 Jelmer Vernooij <jelmer at samba.org>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+"""Mapping upgrade tests."""
+
+from bzrlib.bzrdir import BzrDir
+from bzrlib.repository import Repository
+from bzrlib.tests import (
+    TestCase,
+    TestSkipped,
+    )
+
+from bzrlib.plugins.rebase.upgrade import (
+    UpgradeChangesContent,
+    upgrade_branch,
+    upgrade_repository,
+    upgrade_workingtree,
+    create_upgraded_revid,
+    generate_upgrade_map,
+    )
+
+
+class TestUpgradeChangesContent(TestCase):
+
+    def test_init(self):
+        x = UpgradeChangesContent("revisionx")
+        self.assertEqual("revisionx", x.revid)
+
+
+class ParserTests(TestCase):
+
+    def test_create_upgraded_revid_new(self):
+        self.assertEqual("bla-svn3-upgrade",
+                         create_upgraded_revid("bla", "-svn3"))
+
+    def test_create_upgraded_revid_upgrade(self):
+        self.assertEqual("bla-svn3-upgrade",
+                         create_upgraded_revid("bla-svn1-upgrade", "-svn3"))

=== added file 'upgrade.py'
--- a/upgrade.py	1970-01-01 00:00:00 +0000
+++ b/upgrade.py	2009-05-04 18:05:12 +0000
@@ -0,0 +1,269 @@
+# Copyright (C) 2006-2009 by Jelmer Vernooij
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+"""Upgrading revisions made with older versions of the mapping."""
+
+
+import itertools
+
+from bzrlib import (
+    trace,
+    ui,
+    )
+from bzrlib.errors import (
+    BzrError,
+    InvalidRevisionId,
+    NoSuchRevision,
+    )
+from bzrlib.foreign import (
+    update_workingtree_fileids,
+    )
+
+from bzrlib.plugins.rebase.rebase import (
+    generate_transpose_plan,
+    replay_snapshot,
+    rebase,
+    rebase_todo,
+    )
+
+
+class UpgradeChangesContent(BzrError):
+    """Inconsistency was found upgrading the mapping of a revision."""
+    _fmt = """Upgrade will change contents in revision %(revid)s. Use --allow-changes to override."""
+
+    def __init__(self, revid):
+        self.revid = revid
+
+
+def create_upgraded_revid(revid, mapping_suffix, upgrade_suffix="-upgrade"):
+    """Create a new revision id for an upgraded version of a revision.
+    
+    Prevents suffix to be appended needlessly.
+
+    :param revid: Original revision id.
+    :return: New revision id
+    """
+    if revid.endswith(upgrade_suffix):
+        return revid[0:revid.rfind("-svn")] + mapping_suffix + upgrade_suffix
+    else:
+        return revid + mapping_suffix + upgrade_suffix
+
+
+def upgrade_workingtree(wt, foreign_repository, new_mapping, 
+                        allow_changes=False, verbose=False):
+    """Upgrade a working tree.
+
+    :param foreign_repository: Foreign repository object
+    """
+    wt.lock_write()
+    try:
+        old_revid = wt.last_revision()
+        revid_renames = upgrade_branch(wt.branch, foreign_repository, new_mapping=new_mapping,
+                                 allow_changes=allow_changes, verbose=verbose)
+        last_revid = wt.branch.last_revision()
+        if old_revid == last_revid:
+            return revid_renames
+        new_tree = wt.branch.repository.revision_tree(last_revid)
+        update_workingtree_fileids(wt, new_tree)
+    finally:
+        wt.unlock()
+
+    return revid_renames
+
+
+def upgrade_tags(tags, repository, foreign_repository, new_mapping, 
+                 allow_changes=False, verbose=False, branch_renames=None,
+                 branch_ancestry=None):
+    """Upgrade a tags dictionary."""
+    renames = {}
+    if branch_renames is not None:
+        renames.update(branch_renames)
+    pb = ui.ui_factory.nested_progress_bar()
+    try:
+        tags_dict = tags.get_tag_dict()
+        for i, (name, revid) in enumerate(tags_dict.iteritems()):
+            pb.update("upgrading tags", i, len(tags_dict))
+            if not revid in renames:
+                renames.update(upgrade_repository(repository, foreign_repository, 
+                      revision_id=revid, new_mapping=new_mapping,
+                      allow_changes=allow_changes, verbose=verbose))
+            if revid in renames and (branch_ancestry is None or not revid in branch_ancestry):
+                tags.set_tag(name, renames[revid])
+    finally:
+        pb.finished()
+
+
+def upgrade_branch(branch, foreign_repository, new_mapping, 
+                   allow_changes=False, verbose=False):
+    """Upgrade a branch to the current mapping version.
+    
+    :param branch: Branch to upgrade.
+    :param foreign_repository: Repository to fetch new revisions from
+    :param allow_changes: Allow changes in mappings.
+    :param verbose: Whether to print verbose list of rewrites
+    """
+    revid = branch.last_revision()
+    renames = upgrade_repository(branch.repository, foreign_repository, 
+              revision_id=revid, new_mapping=new_mapping,
+              allow_changes=allow_changes, verbose=verbose)
+    if revid in renames:
+        branch.generate_revision_history(renames[revid])
+    ancestry = branch.repository.get_ancestry(branch.last_revision(), topo_sorted=False)
+    upgrade_tags(branch.tags, branch.repository, foreign_repository, 
+           new_mapping=new_mapping, 
+           allow_changes=allow_changes, verbose=verbose, branch_renames=renames,
+           branch_ancestry=ancestry)
+    return renames
+
+
+def check_revision_changed(oldrev, newrev):
+    """Check if two revisions are different. This is exactly the same 
+    as Revision.equals() except that it does not check the revision_id."""
+    if (newrev.inventory_sha1 != oldrev.inventory_sha1 or
+        newrev.timestamp != oldrev.timestamp or
+        newrev.message != oldrev.message or
+        newrev.timezone != oldrev.timezone or
+        newrev.committer != oldrev.committer or
+        newrev.properties != oldrev.properties):
+        raise UpgradeChangesContent(oldrev.revision_id)
+
+
+def generate_upgrade_map(revs, vcs, determine_upgraded_revid):
+    """Generate an upgrade map for use by bzr-rebase.
+
+    :param new_mapping: Mapping to upgrade revisions to.
+    :param vcs: The foreign vcs
+    :param revs: Iterator over revisions to upgrade.
+    :return: Map from old revids as keys, new revids as values stored in a 
+             dictionary.
+    """
+    rename_map = {}
+    # Create a list of revisions that can be renamed during the upgrade
+    for revid in revs:
+        assert isinstance(revid, str)
+        try:
+            (foreign_revid, old_mapping) = vcs.mapping_registry.parse_revision_id(revid)
+        except InvalidRevisionId:
+            # Not a foreign revision, nothing to do
+            continue
+        newrevid = determine_upgraded_revid(foreign_revid)
+        if newrevid in (revid, None):
+            continue
+        rename_map[revid] = newrevid
+    return rename_map
+
+
+def create_upgrade_plan(repository, foreign_repository, new_mapping,
+                        revision_id=None, allow_changes=False):
+    """Generate a rebase plan for upgrading revisions.
+
+    :param repository: Repository to do upgrade in
+    :param foreign_repository: Subversion repository to fetch new revisions from.
+    :param new_mapping: New mapping to use.
+    :param revision_id: Revision to upgrade (None for all revisions in 
+        repository.)
+    :param allow_changes: Whether an upgrade is allowed to change the contents
+        of revisions.
+    :return: Tuple with a rebase plan and map of renamed revisions.
+    """
+
+    graph = repository.get_graph()
+    if revision_id is None:
+        potential = repository.all_revision_ids()
+    else:
+        potential = itertools.imap(lambda (rev, parents): rev, 
+                graph.iter_ancestry([revision_id]))
+
+    def determine_upgraded_revid(foreign_revid):
+        # FIXME: Try all mappings until new_mapping rather than just new_mapping
+        new_revid = foreign_repository.upgrade_foreign_revision_id(foreign_revid, new_mapping)
+        if new_revid is None:
+            return None
+        # Make sure the revision is there
+        if not repository.has_revision(new_revid):
+            try:
+                repository.fetch(foreign_repository, new_revid)
+            except NoSuchRevision:
+                return None
+            if not repository.has_revision(new_revid):
+                return None
+        return new_revid
+
+    upgrade_map = generate_upgrade_map(potential, foreign_repository.vcs, 
+                                       determine_upgraded_revid)
+   
+    if not allow_changes:
+        for oldrevid, newrevid in upgrade_map.iteritems():
+            oldrev = repository.get_revision(oldrevid)
+            newrev = repository.get_revision(newrevid)
+            check_revision_changed(oldrev, newrev)
+
+    if revision_id is None:
+        heads = repository.all_revision_ids() 
+    else:
+        heads = [revision_id]
+
+    def determine_new_revid(old_revid):
+        # If this revision id already exists round-tripped upstream, 
+        # leave it alone.
+        if foreign_repository.has_revision(old_revid):
+            return old_revid
+        # if not, return old_revid'
+        return create_upgraded_revid(old_revid, new_mapping.upgrade_suffix)
+
+    plan = generate_transpose_plan(graph.iter_ancestry(heads), upgrade_map, 
+      graph, determine_new_revid)
+    def remove_parents((oldrevid, (newrevid, parents))):
+        return (oldrevid, newrevid)
+    upgrade_map.update(dict(map(remove_parents, plan.iteritems())))
+
+    return (plan, upgrade_map)
+
+ 
+def upgrade_repository(repository, foreign_repository, new_mapping, 
+                       revision_id=None, allow_changes=False, 
+                       verbose=False):
+    """Upgrade the revisions in repository until the specified stop revision.
+
+    :param repository: Repository in which to upgrade.
+    :param foreign_repository: Repository to fetch new revisions from.
+    :param new_mapping: New mapping.
+    :param revision_id: Revision id up until which to upgrade, or None for 
+                        all revisions.
+    :param allow_changes: Allow changes to mappings.
+    :param verbose: Whether to print list of rewrites
+    :return: Dictionary of mapped revisions
+    """
+
+    # Find revisions that need to be upgraded, create
+    # dictionary with revision ids in key, new parents in value
+    try:
+        repository.lock_write()
+        foreign_repository.lock_read()
+        (plan, revid_renames) = create_upgrade_plan(repository, foreign_repository, 
+                                                    new_mapping, 
+                                                    revision_id=revision_id,
+                                                    allow_changes=allow_changes)
+        if verbose:
+            for revid in rebase_todo(repository, plan):
+                trace.info("%s -> %s" % (revid, plan[revid][0]))
+        rebase(repository, plan, replay_snapshot)
+        return revid_renames
+    finally:
+        repository.unlock()
+        foreign_repository.unlock()
+



More information about the Pkg-bazaar-commits mailing list