diff -Nru bzr-xmloutput-0.8.8/cmds.py bzr-xmloutput-0.8.8+bzr160/cmds.py --- bzr-xmloutput-0.8.8/cmds.py 2011-11-05 05:18:33.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/cmds.py 2011-12-12 15:11:38.000000000 +0000 @@ -22,36 +22,39 @@ import info import bzrlib +from bzrlib.option import Option +from bzrlib.commands import ( + Command, + display_command, + ) from bzrlib.lazy_import import lazy_import lazy_import(globals(), """ import sys from bzrlib import ( builtins, bzrdir, - commands, - option, log, workingtree, errors ) -from bzrlib.option import Option, custom_help -from bzrlib.commands import display_command -import logxml -import service +from bzrlib.plugins.xmloutput import ( + logxml, + service, + ) import socket -from xml_errors import handle_error_xml """) +from bzrlib.plugins.xmloutput.xml_errors import handle_error_xml version_info = info.bzr_plugin_version plugin_name = info.bzr_plugin_name -null_option = option.Option('null', - help='Write an ascii NUL (\\0) as the final char.') +null_option = Option('null', + help='Write an ascii NUL (\\0) as the final char.') -class cmd_xmlstatus(commands.Command): +class cmd_xmlstatus(Command): """Display status summary. This reports on versioned and unknown files, reporting them @@ -118,7 +121,7 @@ self.outf.write('\n') -class cmd_xmlannotate(commands.Command): +class cmd_xmlannotate(Command): """Show the origin of each line in a file. This prints out the given file with an annotation on the left side @@ -176,7 +179,7 @@ branch.unlock() -class cmd_xmlmissing(commands.Command): +class cmd_xmlmissing(Command): """Show unmerged/unpulled revisions between two branches. OTHER_BRANCH may be local or remote. @@ -212,7 +215,7 @@ self.outf.write('\n') -class cmd_xmlinfo(commands.Command): +class cmd_xmlinfo(Command): """Show information about a working tree, branch or repository. This command will show all known locations and formats associated to the @@ -247,7 +250,7 @@ self.outf.write('\n') -class cmd_xmlplugins(commands.Command): +class cmd_xmlplugins(Command): """List the installed plugins. This command displays the list of installed plugins including @@ -284,7 +287,7 @@ self.outf.write('\n') -class cmd_xmlversion(commands.Command): +class cmd_xmlversion(Command): """Show version of bzr.""" hidden = True encoding_type = 'replace' @@ -383,7 +386,7 @@ self.outf.write('\0') self.outf.write('\n') -class cmd_start_xmlrpc(commands.Command): +class cmd_start_xmlrpc(Command): """Start the xmlrpc service.""" hidden = True @@ -413,7 +416,7 @@ self.server.shutdown() -class cmd_stop_xmlrpc(commands.Command): +class cmd_stop_xmlrpc(Command): """Stops a xmlrpc service.""" hidden = True diff -Nru bzr-xmloutput-0.8.8/debian/changelog bzr-xmloutput-0.8.8+bzr160/debian/changelog --- bzr-xmloutput-0.8.8/debian/changelog 2011-11-08 23:58:35.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/debian/changelog 2012-03-11 10:20:32.000000000 +0000 @@ -1,8 +1,27 @@ -bzr-xmloutput (0.8.8-1~bazaar1~lucid1) lucid; urgency=low +bzr-xmloutput (0.8.8+bzr160-2~bazaar1~lucid1) lucid; urgency=low * Rebuild in PPA. - -- Max Bowsher <_@maxb.eu> Tue, 08 Nov 2011 23:58:35 +0000 + -- Max Bowsher <_@maxb.eu> Sun, 11 Mar 2012 10:20:32 +0000 + +bzr-xmloutput (0.8.8+bzr160-2) unstable; urgency=low + + * Add patches to improve compatibility with newer versions of bzr: + + 01_no_inventory: Don't rely on inventories being available + + 02_elementtree: Use correct location of elementtree. Closes: #660728 + + 03_info_controldir: Fix support for 'bzr xmlinfo' in empty control + directories. + + 04_no_revision_history: Avoid using deprecated `Branch.revision_history` + call. + + -- Jelmer Vernooij Tue, 21 Feb 2012 11:30:46 +0100 + +bzr-xmloutput (0.8.8+bzr160-1) unstable; urgency=low + + * New upstream snapshot. + + Fixes compatibility with bzr 2.5 beta 5 and later. + + -- Jelmer Vernooij Tue, 20 Dec 2011 02:10:28 +0100 bzr-xmloutput (0.8.8-1) unstable; urgency=low diff -Nru bzr-xmloutput-0.8.8/debian/patches/01_no_inventory bzr-xmloutput-0.8.8+bzr160/debian/patches/01_no_inventory --- bzr-xmloutput-0.8.8/debian/patches/01_no_inventory 1970-01-01 00:00:00.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/debian/patches/01_no_inventory 2012-02-21 10:27:07.000000000 +0000 @@ -0,0 +1,52 @@ +Description: Avoid direct access to inventories (deprecated in bzr 2.6). +Origin: commit, revision id: jelmer@samba.org-20120221100557-dqfwsv5vej9g2l2x +Author: Jelmer Vernooij +Last-Update: 2012-02-21 +Applied-Upstream: no +X-Bzr-Revision-Id: jelmer@samba.org-20120221100557-dqfwsv5vej9g2l2x + +=== modified file 'cmds.py' +--- old/cmds.py 2011-12-12 15:11:38 +0000 ++++ new/cmds.py 2012-02-21 10:05:57 +0000 +@@ -163,7 +163,7 @@ + if file_id is None: + raise bzrlib.errors.NotVersionedError(filename) + +- file_version = tree.inventory[file_id].revision ++ file_version = tree.get_file_revision(file_id) + # always run with --all and --long options + # to get the author of each line + annotate_file_xml(branch=branch, rev_id=file_version, + +=== modified file 'infoxml.py' +--- old/infoxml.py 2011-12-12 15:11:38 +0000 ++++ new/infoxml.py 2012-02-21 10:05:57 +0000 +@@ -216,7 +216,6 @@ + """Show missing revisions in working tree.""" + branch = working.branch + basis = working.basis_tree() +- work_inv = working.inventory + branch_revno, branch_last_revision = branch.last_revision_info() + try: + tree_last_id = working.get_parent_ids()[0] +@@ -233,7 +232,6 @@ + def _show_working_stats_xml(working, outfile): + """Show statistics about a working tree.""" + basis = working.basis_tree() +- work_inv = working.inventory + delta = working.changes_from(basis, want_unchanged=True) + + outfile.write('') +@@ -254,9 +252,8 @@ + outfile.write('%d' % ignore_cnt) + + dir_cnt = 0 +- for file_id in work_inv: +- if (work_inv.get_file_kind(file_id) == 'directory' and +- not work_inv.is_root(file_id)): ++ for path, entry in working.iter_entries_by_dir(): ++ if entry.kind == 'directory' and entry.parent_id is not None: + dir_cnt += 1 + outfile.write('%d' % + (dir_cnt)) + diff -Nru bzr-xmloutput-0.8.8/debian/patches/02_elementtree bzr-xmloutput-0.8.8+bzr160/debian/patches/02_elementtree --- bzr-xmloutput-0.8.8/debian/patches/02_elementtree 1970-01-01 00:00:00.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/debian/patches/02_elementtree 2012-02-21 10:29:00.000000000 +0000 @@ -0,0 +1,129 @@ +Origin: commit, revision id: jelmer@samba.org-20120221101416-t8d0yp7omic40qqt +Author: Jelmer Vernooij +Description: Use correct elementtree +Last-Update: 2012-02-21 +Applied-Upstream: no +X-Bzr-Revision-Id: jelmer@samba.org-20120221101416-t8d0yp7omic40qqt + +=== modified file 'tests/elementtree_builder.py' +--- old/tests/elementtree_builder.py 2007-11-26 02:21:31 +0000 ++++ new/tests/elementtree_builder.py 2012-02-21 10:14:16 +0000 +@@ -1,7 +1,7 @@ + +-from bzrlib.xml_serializer import elementtree as elementtree ++from bzrlib.xml_serializer import elementtree + +-ET = elementtree.ElementTree ++ET = elementtree + + class _E(object): + """ This is the E factory, taken from http://effbot.org/zone/element-builder.htm """ + +=== modified file 'tests/test_annotate_xml.py' +--- old/tests/test_annotate_xml.py 2009-09-23 03:29:47 +0000 ++++ new/tests/test_annotate_xml.py 2012-02-21 10:14:16 +0000 +@@ -30,7 +30,7 @@ + + from bzrlib.tests import TestCaseWithTransport + from bzrlib.xml_serializer import elementtree as elementtree +-fromstring = elementtree.ElementTree.fromstring ++fromstring = elementtree.fromstring + + class TestXmlAnnotate(TestCaseWithTransport): + +@@ -91,7 +91,8 @@ + self.assertEqualDiff(expected_xml, out) + expected_elementtree = fromstring(expected_xml) + current_elementtree = fromstring(out) +- self.assertEquals(elementtree.ElementTree.tostring(expected_elementtree), elementtree.ElementTree.tostring(current_elementtree)) ++ self.assertEquals(elementtree.tostring(expected_elementtree), ++ elementtree.tostring(current_elementtree)) + + def test_xmlannotate_cmd_show_ids(self): + out, err = self.run_bzr('xmlannotate hello.txt --show-ids') + +=== modified file 'tests/test_log_xml.py' +--- old/tests/test_log_xml.py 2009-09-23 03:29:47 +0000 ++++ new/tests/test_log_xml.py 2012-02-21 10:14:16 +0000 +@@ -26,8 +26,8 @@ + from bzrlib.tests.blackbox import ExternalBase + from bzrlib.tests import TestCaseInTempDir, TestCaseWithTransport + from bzrlib.xml_serializer import elementtree as elementtree +-fromstring = elementtree.ElementTree.fromstring +-elementtree_tostring = elementtree.ElementTree.tostring ++fromstring = elementtree.fromstring ++elementtree_tostring = elementtree.tostring + + class TestLog(ExternalBase): + + +=== modified file 'tests/test_ls_xml.py' +--- old/tests/test_ls_xml.py 2011-10-16 23:56:35 +0000 ++++ new/tests/test_ls_xml.py 2012-02-21 10:14:16 +0000 +@@ -21,7 +21,7 @@ + from bzrlib import ignores + from bzrlib.tests import TestCaseWithTransport + from bzrlib.xml_serializer import elementtree as elementtree +-fromstring = elementtree.ElementTree.fromstring ++fromstring = elementtree.fromstring + + + class TestLSXML(TestCaseWithTransport): + +=== modified file 'tests/test_status_xml.py' +--- old/tests/test_status_xml.py 2010-03-26 03:38:04 +0000 ++++ new/tests/test_status_xml.py 2012-02-21 10:14:16 +0000 +@@ -38,13 +38,11 @@ + from bzrlib.osutils import pathjoin + from bzrlib.revisionspec import RevisionSpec + from bzrlib.tests import TestCaseWithTransport, TestSkipped +-from bzrlib.workingtree import WorkingTree + from bzrlib.xml_serializer import elementtree as elementtree + + import bzrlib.plugin +-from bzrlib.status import show_tree_status +-fromstring = elementtree.ElementTree.fromstring +-from elementtree_builder import (ET, _E) ++fromstring = elementtree.fromstring ++from elementtree_builder import _E + + ## little hack to load functions from parent module + show_tree_status_xml = None +@@ -322,8 +320,9 @@ + self.assertEquals(result.findall('unknown/file')[0].text, "world.txt") + + result2 = fromstring(self.run_bzr("xmlstatus -r 0..")[0]) +- self.assertEquals(elementtree.ElementTree.tostring(result2), +- elementtree.ElementTree.tostring(result)) ++ self.assertEquals( ++ elementtree.tostring(result2), ++ elementtree.tostring(result)) + + def test_statusxml_versioned(self): + tree = self.make_branch_and_tree('.') +@@ -346,8 +345,9 @@ + self.assert_(len(result.findall('unknown/*')) == 0) + + result2 = fromstring(self.run_bzr("xmlstatus --versioned -r 0..")[0]) +- self.assertEquals(elementtree.ElementTree.tostring(result2), +- elementtree.ElementTree.tostring(result)) ++ self.assertEquals( ++ elementtree.tostring(result2), ++ elementtree.tostring(result)) + + # Not yet implemneted + #def assertStatusContains(self, xpath): + +=== modified file 'tests/test_version_xml.py' +--- old/tests/test_version_xml.py 2011-03-09 22:58:39 +0000 ++++ new/tests/test_version_xml.py 2012-02-21 10:14:16 +0000 +@@ -27,7 +27,7 @@ + ) + + from bzrlib.xml_serializer import elementtree as elementtree +-fromstring = elementtree.ElementTree.fromstring ++fromstring = elementtree.fromstring + + from bzrlib.plugins.xmloutput import versionxml + + diff -Nru bzr-xmloutput-0.8.8/debian/patches/03_info_controldir bzr-xmloutput-0.8.8+bzr160/debian/patches/03_info_controldir --- bzr-xmloutput-0.8.8/debian/patches/03_info_controldir 1970-01-01 00:00:00.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/debian/patches/03_info_controldir 2012-02-21 10:29:29.000000000 +0000 @@ -0,0 +1,20 @@ +Origin: commit, revision id: jelmer@samba.org-20120221101857-e77da9mh3ytjrh6f +Author: Jelmer Vernooij +Description: Fix 'bzr xmlinfo' in empty control directories +Last-Update: 2012-02-21 +Applied-Upstream: no +X-Bzr-Revision-Id: jelmer@samba.org-20120221101857-e77da9mh3ytjrh6f + +=== modified file 'infoxml.py' +--- old/infoxml.py 2011-12-12 15:11:38 +0000 ++++ new/infoxml.py 2012-02-21 10:18:57 +0000 +@@ -102,7 +102,7 @@ + verbose = 1 + if verbose is True: + verbose = 2 +- layout = info.describe_layout(repository, branch, working) ++ layout = info.describe_layout(repository, branch, working, control) + formats = info.describe_format(control, repository, + branch, working).split(' or ') + outfile.write('%s' % layout) + diff -Nru bzr-xmloutput-0.8.8/debian/patches/04_no_revision_history bzr-xmloutput-0.8.8+bzr160/debian/patches/04_no_revision_history --- bzr-xmloutput-0.8.8/debian/patches/04_no_revision_history 1970-01-01 00:00:00.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/debian/patches/04_no_revision_history 2012-02-21 10:26:24.000000000 +0000 @@ -0,0 +1,38 @@ +Description: Avoid deprecated Branch.revision_history(). +Origin: commit, revision id: jelmer@samba.org-20120221102451-9wz5wjb01drb0am4 +Author: Jelmer Vernooij +Last-Update: 2012-02-21 +Applied-Upstream: no +X-Bzr-Revision-Id: jelmer@samba.org-20120221102451-9wz5wjb01drb0am4 + +=== modified file 'tests/test_info_xml.py' +--- old/tests/test_info_xml.py 2011-10-16 23:56:35 +0000 ++++ new/tests/test_info_xml.py 2012-02-21 10:24:51 +0000 +@@ -135,7 +135,7 @@ + self.assertEqualDiff(expected_xml, out) + self.assertEqual('', err) + tree1.commit('commit one') +- rev = branch1.repository.get_revision(branch1.revision_history()[0]) ++ rev = branch1.repository.get_revision(branch1.last_revision()) + datestring_first = osutils.format_date(rev.timestamp, rev.timezone) + + # Branch standalone with push location +@@ -670,7 +670,7 @@ + self.build_tree(['tree/lightcheckout/a']) + tree2.add('a') + tree2.commit('commit one') +- rev = repo.get_revision(branch2.revision_history()[0]) ++ rev = repo.get_revision(branch2.last_revision()) + datestring_first = osutils.format_date(rev.timestamp, rev.timezone) + out, err = self.run_bzr('xmlinfo tree/lightcheckout --verbose') + expected_xml = ''' +@@ -1010,7 +1010,7 @@ + tree1 = branch1.bzrdir.open_workingtree() + tree1.add('a') + tree1.commit('commit one') +- rev = repo.get_revision(branch1.revision_history()[0]) ++ rev = repo.get_revision(branch1.last_revision()) + datestring_first = osutils.format_date(rev.timestamp, rev.timezone) + out, err = self.run_bzr('xmlinfo -v repo/branch1') + expected_xml = ''' + diff -Nru bzr-xmloutput-0.8.8/debian/patches/series bzr-xmloutput-0.8.8+bzr160/debian/patches/series --- bzr-xmloutput-0.8.8/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/debian/patches/series 2012-02-21 10:29:42.000000000 +0000 @@ -0,0 +1,4 @@ +01_no_inventory +02_elementtree +03_info_controldir +04_no_revision_history diff -Nru bzr-xmloutput-0.8.8/infoxml.py bzr-xmloutput-0.8.8+bzr160/infoxml.py --- bzr-xmloutput-0.8.8/infoxml.py 2011-11-05 05:18:33.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/infoxml.py 2011-12-12 15:11:38.000000000 +0000 @@ -27,6 +27,7 @@ __all__ = ['show_bzrdir_info_xml'] +from bzrlib import info from bzrlib.lazy_import import lazy_import lazy_import(globals(), """ import os, sys, time @@ -36,7 +37,6 @@ errors, osutils, urlutils, - info, missing, ) """) diff -Nru bzr-xmloutput-0.8.8/logxml.py bzr-xmloutput-0.8.8+bzr160/logxml.py --- bzr-xmloutput-0.8.8/logxml.py 2011-11-05 05:18:33.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/logxml.py 2011-12-12 15:11:38.000000000 +0000 @@ -1,14 +1,12 @@ # -*- encoding: utf-8 -*- -import os - +from bzrlib import log from bzrlib.lazy_import import lazy_import lazy_import(globals(), """ import bzrlib from bzrlib import ( debug, osutils, - log, ) """) diff -Nru bzr-xmloutput-0.8.8/lsxml.py bzr-xmloutput-0.8.8+bzr160/lsxml.py --- bzr-xmloutput-0.8.8/lsxml.py 2011-11-05 05:18:33.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/lsxml.py 2011-12-12 15:11:38.000000000 +0000 @@ -19,8 +19,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # -import os - from bzrlib.lazy_import import lazy_import lazy_import(globals(), """ from bzrlib import bzrdir, errors, osutils diff -Nru bzr-xmloutput-0.8.8/service.py bzr-xmloutput-0.8.8+bzr160/service.py --- bzr-xmloutput-0.8.8/service.py 2011-11-05 05:18:33.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/service.py 2011-12-12 15:11:38.000000000 +0000 @@ -20,6 +20,8 @@ # """ xmlrpc service module """ +import os + from bzrlib.lazy_import import lazy_import lazy_import(globals(), """ import bzrlib @@ -30,14 +32,13 @@ osutils ) import sys -import os import codecs import logging import traceback from cStringIO import StringIO """) -from xml_errors import XMLError +from bzrlib.plugins.xmloutput.xml_errors import XMLError from xmlrpclib import Fault, Binary from SimpleXMLRPCServer import SimpleXMLRPCServer diff -Nru bzr-xmloutput-0.8.8/statusxml.py bzr-xmloutput-0.8.8+bzr160/statusxml.py --- bzr-xmloutput-0.8.8/statusxml.py 2011-11-05 05:18:33.000000000 +0000 +++ bzr-xmloutput-0.8.8+bzr160/statusxml.py 2011-12-12 15:11:38.000000000 +0000 @@ -33,7 +33,7 @@ trace, ) -import logxml +from bzrlib.plugins.xmloutput import logxml """) from writer import _escape_cdata