diff -Nru bzrtools-1.6.0/bzrtools.py bzrtools-1.11.0/bzrtools.py --- bzrtools-1.6.0/bzrtools.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/bzrtools.py 2009-01-12 13:57:15.000000000 +0000 @@ -202,7 +202,7 @@ class NotStandalone(BzrError): - _format = '%(location) is not a standalone tree.' + _fmt = '%(location)s is not a standalone tree.' _internal = False def __init__(self, location): diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/clean_tree.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/clean_tree.py --- bzrtools-1.6.0/clean_tree.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/clean_tree.py 2009-01-12 13:57:15.000000000 +0000 @@ -44,13 +44,23 @@ def clean_tree(directory, unknown=False, ignored=False, detritus=False, - dry_run=False): + dry_run=False, no_prompt=False): """Remove files in the specified classes from the tree""" tree = WorkingTree.open_containing(directory)[0] tree.lock_read() try: - deletables = iter_deletables(tree, unknown=unknown, ignored=ignored, - detritus=detritus) + deletables = list(iter_deletables(tree, unknown=unknown, + ignored=ignored, detritus=detritus)) + if len(deletables) == 0: + note('Nothing to delete.') + return 0 + if not no_prompt: + for path, subp in deletables: + print subp + val = raw_input('Are you sure you wish to delete these [y/N]?') + if val.lower() not in ('y', 'yes'): + print 'Canceled' + return 0 delete_items(deletables, dry_run=dry_run) finally: tree.unlock() diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/colordiff.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/colordiff.py --- bzrtools-1.6.0/colordiff.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/colordiff.py 2009-01-12 13:57:15.000000000 +0000 @@ -42,22 +42,35 @@ class DiffWriter(object): - colors = { - 'metaline': 'darkyellow', - 'plain': 'darkwhite', - 'newtext': 'darkblue', - 'oldtext': 'darkred', - 'diffstuff': 'darkgreen', - 'trailingspace': 'yellow', - 'leadingtabs': 'magenta', - 'longline': 'cyan', - } - - def __init__(self, target, check_style): + def __init__(self, target, check_style=False, color='always'): self.target = target self.lp = LineParser() self.chunks = [] - self._read_colordiffrc() + from terminal import has_ansi_colors + if 'always' == color or ('auto' == color and has_ansi_colors()): + self.colors = { + 'metaline': 'darkyellow', + 'plain': 'darkwhite', + 'newtext': 'darkblue', + 'oldtext': 'darkred', + 'diffstuff': 'darkgreen', + 'trailingspace': 'yellow', + 'leadingtabs': 'magenta', + 'longline': 'cyan', + } + self._read_colordiffrc('/etc/colordiffrc') + self._read_colordiffrc(expanduser('~/.colordiffrc')) + else: + self.colors = { + 'metaline': None, + 'plain': None, + 'newtext': None, + 'oldtext': None, + 'diffstuff': None, + 'trailingspace': None, + 'leadingtabs': None, + 'longline': None, + } self.added_leading_tabs = 0 self.added_trailing_whitespace = 0 self.spurious_whitespace = 0 @@ -67,8 +80,7 @@ self._old_lines = [] self.check_style = check_style - def _read_colordiffrc(self): - path = expanduser('~/.colordiffrc') + def _read_colordiffrc(self, path): try: f = open(path, 'r') except IOError: @@ -179,9 +191,13 @@ self._old_lines, self._new_lines = ([], []) -def colordiff(check_style, *args, **kwargs): +def auto_diff_writer(output): + return DiffWriter(output, color='auto') + + +def colordiff(color, check_style, *args, **kwargs): real_stdout = sys.stdout - dw = DiffWriter(real_stdout, check_style) + dw = DiffWriter(real_stdout, check_style, color) sys.stdout = dw try: get_cmd_object('diff').run(*args, **kwargs) diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/command_classes.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/command_classes.py --- bzrtools-1.6.0/command_classes.py 1970-01-01 01:00:00.000000000 +0100 +++ bzrtools-1.11.0/command_classes.py 2009-01-12 13:57:15.000000000 +0000 @@ -0,0 +1,593 @@ +# Copyright (C) 2005, 2006, 2007 Aaron Bentley +# Copyright (C) 2005, 2006 Canonical Limited. +# Copyright (C) 2006 Michael Ellerman. +# +# 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 + +import bzrlib + +from bzrlib.lazy_import import lazy_import +lazy_import(globals(), """ +from bzrlib import help, urlutils +import shelf +""") + +from command import BzrToolsCommand +from errors import CommandError +from patchsource import BzrPatchSource +import sys +import os.path + +import bzrlib.builtins +import bzrlib.commands +from bzrlib.branch import Branch +from bzrlib.bzrdir import BzrDir +from bzrlib.commands import get_cmd_object +from bzrlib.errors import BzrCommandError +import bzrlib.ignores +from bzrlib.trace import note +from bzrlib.option import Option, RegistryOption + +from command import BzrToolsCommand + + +class cmd_clean_tree(BzrToolsCommand): + """Remove unwanted files from working tree. + + By default, only unknown files, not ignored files, are deleted. Versioned + files are never deleted. + + Another class is 'detritus', which includes files emitted by bzr during + normal operations and selftests. (The value of these files decreases with + time.) + + If no options are specified, unknown files are deleted. Otherwise, option + flags are respected, and may be combined. + + To check what clean-tree will do, use --dry-run. + """ + takes_options = [Option('ignored', help='Delete all ignored files.'), + Option('detritus', help='Delete conflict files, merge' + ' backups, and failed selftest dirs.'), + Option('unknown', + help='Delete files unknown to bzr (default).'), + Option('dry-run', help='Show files to delete instead of' + ' deleting them.'), + Option('force', help='Do not prompt before deleting.')] + def run(self, unknown=False, ignored=False, detritus=False, dry_run=False, + force=False): + from clean_tree import clean_tree + if not (unknown or ignored or detritus): + unknown = True + if dry_run: + force = True + clean_tree('.', unknown=unknown, ignored=ignored, detritus=detritus, + dry_run=dry_run, no_prompt=force) + + +class cmd_graph_ancestry(BzrToolsCommand): + """Produce ancestry graphs using dot. + + Output format is detected according to file extension. Some of the more + common output formats are html, png, gif, svg, ps. An extension of '.dot' + will cause a dot graph file to be produced. HTML output has mouseovers + that show the commit message. + + Branches are labeled r?, where ? is the revno. If they have no revno, + with the last 5 characters of their revision identifier are used instead. + + The value starting with d is "(maximum) distance from the null revision". + + If --merge-branch is specified, the two branches are compared and a merge + base is selected. + + Legend: + white normal revision + yellow THIS history + red OTHER history + orange COMMON history + blue COMMON non-history ancestor + green Merge base (COMMON ancestor farthest from the null revision) + dotted Ghost revision (missing from branch storage) + + Ancestry is usually collapsed by skipping revisions with a single parent + and descendant. The number of skipped revisions is shown on the arrow. + This feature can be disabled with --no-collapse. + + By default, revisions are ordered by distance from root, but they can be + clustered instead using --cluster. + + If available, rsvg is used to antialias PNG and JPEG output, but this can + be disabled with --no-antialias. + """ + takes_args = ['file', 'merge_branch?'] + takes_options = [Option('no-collapse', help="Do not skip simple nodes."), + Option('no-antialias', + help="Do not use rsvg to produce antialiased output."), + Option('merge-branch', type=str, + help="Use this branch to calcuate a merge base."), + Option('cluster', help="Use clustered output."), + Option('max-distance', + help="Show no nodes farther than this.", type=int), + Option('directory', + help='Source branch to use (default is current' + ' directory).', + short_name='d', + type=unicode), + ] + def run(self, file, merge_branch=None, no_collapse=False, + no_antialias=False, cluster=False, max_distance=100, + directory='.'): + if max_distance == -1: + max_distance = None + import graph + if cluster: + ranking = "cluster" + else: + ranking = "forced" + graph.write_ancestry_file(directory, file, not no_collapse, + not no_antialias, merge_branch, ranking, + max_distance=max_distance) + + +class cmd_fetch_ghosts(BzrToolsCommand): + """Attempt to retrieve ghosts from another branch. + If the other branch is not supplied, the last-pulled branch is used. + """ + aliases = ['fetch-missing'] + takes_args = ['branch?'] + takes_options = [Option('no-fix', help="Skip additional synchonization.")] + def run(self, branch=None, no_fix=False): + from fetch_ghosts import fetch_ghosts + fetch_ghosts(branch, no_fix) + +strip_help="""Strip the smallest prefix containing num leading slashes from \ +each file name found in the patch file.""" + + +class cmd_patch(BzrToolsCommand): + """Apply a named patch to the current tree. + """ + takes_args = ['filename?'] + takes_options = [Option('strip', type=int, help=strip_help), + Option('silent', help='Suppress chatter.')] + def run(self, filename=None, strip=None, silent=False): + from patch import patch + from bzrlib.workingtree import WorkingTree + wt = WorkingTree.open_containing('.')[0] + if strip is None: + strip = 0 + return patch(wt, filename, strip, silent) + + +class cmd_shelve1(BzrToolsCommand): + """Temporarily set aside some changes from the current tree. + + Shelve allows you to temporarily put changes you've made "on the shelf", + ie. out of the way, until a later time when you can bring them back from + the shelf with the 'unshelve1' command. + + Shelve is intended to help separate several sets of text changes that have + been inappropriately mingled. If you just want to get rid of all changes + (text and otherwise) and you don't need to restore them later, use revert. + If you want to shelve all text changes at once, use shelve1 --all. + + By default shelve1 asks you what you want to shelve, press '?' at the + prompt to get help. To shelve everything run shelve1 --all. + + If filenames are specified, only the changes to those files will be + shelved, other files will be left untouched. + + If a revision is specified, changes since that revision will be shelved. + + You can put multiple items on the shelf. Normally each time you run + unshelve1 the most recently shelved changes will be reinstated. However, + you can also unshelve changes in a different order by explicitly + specifiying which changes to unshelve1. This works best when the changes + don't depend on each other. + + While you have patches on the shelf you can view and manipulate them with + the 'shelf1' command. Run 'bzr shelf1 -h' for more info. + """ + + takes_args = ['file*'] + takes_options = [Option('message', + help='A message to associate with the shelved changes.', + short_name='m', type=unicode), + 'revision', + Option('all', help='Shelve all changes without prompting.'), + Option('no-color', help='Never display changes in color.')] + + def run(self, all=False, file_list=None, message=None, revision=None, + no_color=False): + if revision is not None and revision: + if len(revision) == 1: + revision = revision[0] + else: + raise CommandError("shelve only accepts a single revision " + "parameter.") + + source = BzrPatchSource(revision, file_list) + s = shelf.Shelf(source.base) + s.shelve(source, all, message, no_color) + return 0 + + +# The following classes are only used as subcommands for 'shelf1', they're +# not to be registered directly with bzr. + +class cmd_shelf_list(bzrlib.commands.Command): + """List the patches on the current shelf.""" + aliases = ['list', 'ls'] + def run(self): + self.shelf.list() + + +class cmd_shelf_delete(bzrlib.commands.Command): + """Delete the patch from the current shelf.""" + aliases = ['delete', 'del'] + takes_args = ['patch'] + def run(self, patch): + self.shelf.delete(patch) + + +class cmd_shelf_switch(bzrlib.commands.Command): + """Switch to the other shelf, create it if necessary.""" + aliases = ['switch'] + takes_args = ['othershelf'] + def run(self, othershelf): + s = shelf.Shelf(self.shelf.base, othershelf) + s.make_default() + + +class cmd_shelf_show(bzrlib.commands.Command): + """Show the contents of the specified or topmost patch.""" + aliases = ['show', 'cat', 'display'] + takes_args = ['patch?'] + def run(self, patch=None): + self.shelf.display(patch) + + +class cmd_shelf_upgrade(bzrlib.commands.Command): + """Upgrade old format shelves.""" + aliases = ['upgrade'] + def run(self): + self.shelf.upgrade() + + +class cmd_shelf1(BzrToolsCommand): + """Perform various operations on your shelved patches. See also shelve1.""" + takes_args = ['subcommand', 'args*'] + + subcommands = [cmd_shelf_list, cmd_shelf_delete, cmd_shelf_switch, + cmd_shelf_show, cmd_shelf_upgrade] + + def run(self, subcommand, args_list): + import sys + + if args_list is None: + args_list = [] + cmd = self._get_cmd_object(subcommand) + source = BzrPatchSource() + s = shelf.Shelf(source.base) + cmd.shelf = s + + if args_list is None: + args_list = [] + return cmd.run_argv_aliases(args_list) + + def _get_cmd_object(self, cmd_name): + for cmd_class in self.subcommands: + for alias in cmd_class.aliases: + if alias == cmd_name: + return cmd_class() + raise CommandError("Unknown shelf subcommand '%s'" % cmd_name) + + def help(self): + text = ["%s\n\nSubcommands:\n" % self.__doc__] + + for cmd_class in self.subcommands: + text.extend(self.sub_help(cmd_class) + ['\n']) + + return ''.join(text) + + def sub_help(self, cmd_class): + text = [] + cmd_obj = cmd_class() + indent = 2 * ' ' + + usage = cmd_obj._usage() + usage = usage.replace('bzr shelf-', '') + text.append('%s%s\n' % (indent, usage)) + + text.append('%s%s\n' % (2 * indent, cmd_class.__doc__)) + + # Somewhat copied from bzrlib.help.help_on_command_options + option_help = [] + for option_name, option in sorted(cmd_obj.options().items()): + if option_name == 'help': + continue + option_help.append('%s--%s' % (3 * indent, option_name)) + if option.type is not None: + option_help.append(' %s' % option.argname.upper()) + if option.short_name(): + option_help.append(', -%s' % option.short_name()) + option_help.append('%s%s\n' % (2 * indent, option.help)) + + if len(option_help) > 0: + text.append('%soptions:\n' % (2 * indent)) + text.extend(option_help) + + return text + + +class cmd_unshelve1(BzrToolsCommand): + """Restore shelved changes. + + By default the most recently shelved changes are restored. However if you + specify a patch by name those changes will be restored instead. + + See 'shelve1' for more information. + """ + takes_options = [ + Option('all', help='Unshelve all changes without prompting.'), + Option('force', help='Force unshelving even if errors occur.'), + Option('no-color', help='Never display changes in color.') + ] + takes_args = ['patch?'] + def run(self, patch=None, all=False, force=False, no_color=False): + source = BzrPatchSource() + s = shelf.Shelf(source.base) + s.unshelve(source, patch, all, force, no_color) + return 0 + + +class cmd_shell(BzrToolsCommand): + """Begin an interactive shell tailored for bzr. + Bzr commands can be used without typing bzr first, and will be run natively + when possible. Tab completion is tailored for bzr. The shell prompt shows + the branch nick, revno, and path. + + If it encounters any moderately complicated shell command, it will punt to + the system shell. + + Example: + $ bzr shell + bzr bzrtools:287/> status + modified: + __init__.py + bzr bzrtools:287/> status --[TAB][TAB] + --all --help --revision --show-ids + bzr bzrtools:287/> status -- + """ + def run(self): + import shell + return shell.run_shell() + + +class cmd_branch_history(BzrToolsCommand): + """\ + Display the development history of a branch. + + Each different committer or branch nick is considered a different line of + development. Committers are treated as the same if they have the same + name, or if they have the same email address. + """ + takes_args = ["branch?"] + def run(self, branch=None): + from branchhistory import branch_history + return branch_history(branch) + + +class cmd_zap(BzrToolsCommand): + """\ + Remove a lightweight checkout, if it can be done safely. + + This command will remove a lightweight checkout without losing data. That + means it only removes lightweight checkouts, and only if they have no + uncommitted changes. + + If --branch is specified, the branch will be deleted too, but only if the + the branch has no new commits (relative to its parent). + """ + takes_options = [Option("branch", help="Remove associated branch from" + " repository."), + Option('force', help='Delete tree even if contents are' + ' modified.')] + takes_args = ["checkout"] + def run(self, checkout, branch=False, force=False): + from zap import zap + return zap(checkout, remove_branch=branch, allow_modified=force) + + +class cmd_cbranch(BzrToolsCommand): + """ + Create a new checkout, associated with a new repository branch. + + When you cbranch, bzr looks up a target location in locations.conf, and + creates the branch there. + + In your locations.conf, add the following lines: + [/working_directory_root] + cbranch_target = /branch_root + cbranch_target:policy = appendpath + + This will mean that if you run "bzr cbranch foo/bar foo/baz" in the + working directory root, the branch will be created in + "/branch_root/foo/baz" + + NOTE: cbranch also supports "cbranch_root", but that behaviour is + deprecated. + """ + takes_options = [Option("lightweight", + help="Create a lightweight checkout."), 'revision', + Option('files-from', type=unicode, + help='Accelerate checkout using files from this' + ' tree.'), + Option('hardlink', + help='Hard-link files from source/files-from tree' + ' where posible.')] + takes_args = ["source", "target?"] + def run(self, source, target=None, lightweight=False, revision=None, + files_from=None, hardlink=False): + from cbranch import cbranch + return cbranch(source, target, lightweight=lightweight, + revision=revision, files_from=files_from, + hardlink=hardlink) + + +class cmd_branches(BzrToolsCommand): + """Scan a location for branches""" + takes_args = ["location?"] + def run(self, location=None): + from branches import branches + return branches(location) + +class cmd_trees(BzrToolsCommand): + """Scan a location for trees""" + takes_args = ['location?'] + def run(self, location='.'): + from bzrlib.workingtree import WorkingTree + from bzrlib.transport import get_transport + t = get_transport(location) + for tree in WorkingTree.find_trees(location): + self.outf.write('%s\n' % t.relpath( + tree.bzrdir.root_transport.base)) + +class cmd_multi_pull(BzrToolsCommand): + """Pull all the branches under a location, e.g. a repository. + + Both branches present in the directory and the branches of checkouts are + pulled. + """ + takes_args = ["location?"] + def run(self, location=None): + from bzrlib.transport import get_transport + from bzrtools import iter_branch_tree + if location is None: + location = '.' + t = get_transport(location) + possible_transports = [] + if not t.listable(): + print "Can't list this type of location." + return 3 + for branch, wt in iter_branch_tree(t): + if wt is None: + pullable = branch + else: + pullable = wt + parent = branch.get_parent() + if parent is None: + continue + if wt is not None: + base = wt.basedir + else: + base = branch.base + if base.startswith(t.base): + relpath = base[len(t.base):].rstrip('/') + else: + relpath = base + print "Pulling %s from %s" % (relpath, parent) + try: + branch_t = get_transport(parent, possible_transports) + pullable.pull(Branch.open_from_transport(branch_t)) + except Exception, e: + print e + + + +class cmd_import(BzrToolsCommand): + """Import sources from a directory, tarball or zip file + + This command will import a directory, tarball or zip file into a bzr + tree, replacing any versioned files already present. If a directory is + specified, it is used as the target. If the directory does not exist, or + is not versioned, it is created. + + Tarballs may be gzip or bzip2 compressed. This is autodetected. + + If the tarball or zip has a single root directory, that directory is + stripped when extracting the tarball. This is not done for directories. + """ + + takes_args = ['source', 'tree?'] + def run(self, source, tree=None): + from upstream_import import do_import + do_import(source, tree) + + +class cmd_cdiff(BzrToolsCommand): + """A color version of bzr's diff""" + takes_args = property(lambda x: get_cmd_object('diff').takes_args) + takes_options = list(get_cmd_object('diff').takes_options) + [ + RegistryOption.from_kwargs('color', + 'Color mode to use.', + title='Color Mode', value_switches=False, enum_switch=True, + never='Never colorize output.', + auto='Only colorize output if terminal supports it and STDOUT is a' + ' TTY.', + always='Always colorize output (default).'), + Option('check-style', + help='Warn if trailing whitespace or spurious changes have been' + ' added.')] + + def run(self, color='always', check_style=False, *args, **kwargs): + from colordiff import colordiff + colordiff(color, check_style, *args, **kwargs) + + +class cmd_rspush(BzrToolsCommand): + """Upload this branch to another location using rsync. + + If no location is specified, the last-used location will be used. To + prevent dirty trees from being uploaded, rspush will error out if there are + unknown files or local changes. It will also error out if the upstream + directory is non-empty and not an earlier version of the branch. + """ + takes_args = ['location?'] + takes_options = [Option('overwrite', help='Ignore differences between' + ' branches and overwrite unconditionally.'), + Option('no-tree', help='Do not push the working tree,' + ' just the .bzr.')] + + def run(self, location=None, overwrite=False, no_tree=False): + from bzrlib import workingtree + import bzrtools + cur_branch = workingtree.WorkingTree.open_containing(".")[0] + bzrtools.rspush(cur_branch, location, overwrite=overwrite, + working_tree=not no_tree) + + +class cmd_link_tree(BzrToolsCommand): + """Hardlink matching files to another tree. + + Only files with identical content and execute bit will be linked. + """ + takes_args = ['location'] + + def run(self, location): + from bzrlib import workingtree + from bzrlib.plugins.bzrtools.link_tree import link_tree + target_tree = workingtree.WorkingTree.open_containing(".")[0] + source_tree = workingtree.WorkingTree.open(location) + target_tree.lock_write() + try: + source_tree.lock_read() + try: + link_tree(target_tree, source_tree) + finally: + source_tree.unlock() + finally: + target_tree.unlock() diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/debian/changelog /tmp/tEYJNCx3jI/bzrtools-1.11.0/debian/changelog --- bzrtools-1.6.0/debian/changelog 2009-02-02 11:36:16.000000000 +0000 +++ bzrtools-1.11.0/debian/changelog 2009-02-02 11:36:16.000000000 +0000 @@ -1,3 +1,51 @@ +bzrtools (1.11.0-1ubuntu1~ppa1) intrepid; urgency=low + + * Backport from Debian Experimental + + -- Jerome Soyer Mon, 02 Feb 2009 12:26:14 +0100 + +bzrtools (1.11.0-1) experimental; urgency=low + + * New upstream release. + + -- Jelmer Vernooij Tue, 13 Jan 2009 16:28:02 +0100 + +bzrtools (1.10.0-1) experimental; urgency=low + + * New upstream release. + + -- Jelmer Vernooij Fri, 28 Nov 2008 16:14:00 +0100 + +bzrtools (1.9.1-1) experimental; urgency=low + + * New upstream release. + + -- Jelmer Vernooij Wed, 05 Nov 2008 15:11:27 +0100 + +bzrtools (1.9.0-1) experimental; urgency=low + + * New upstream release. + + -- Jelmer Vernooij Mon, 03 Nov 2008 19:51:35 +0100 + +bzrtools (1.8.0-1) experimental; urgency=low + + * New upstream release. + + -- Jelmer Vernooij Wed, 08 Oct 2008 13:12:25 +0200 + +bzrtools (1.7.0-2) experimental; urgency=low + + * Fix dependency on newer versions of bzr. + + -- Jelmer Vernooij Tue, 30 Sep 2008 20:37:07 +0200 + +bzrtools (1.7.0-1) experimental; urgency=low + + * New upstream release. + + -- Jelmer Vernooij Wed, 24 Sep 2008 17:18:55 +0200 + bzrtools (1.6.0-1) experimental; urgency=low * New upstream release. @@ -167,7 +215,7 @@ * Update Depends to bzr >= 0.15 and bzr << 0.16. (Closes: #399650, #406397) * Extend full description to list the plugins included. Thanks Jari Aalto and Arnaud Fontaine. (Closes: #415720, #346251) - * Add XS-Vcs-Svn field. + * Add XS-Vcs-Svn field. -- Gustavo Franco Mon, 23 Apr 2007 02:14:58 -0300 @@ -184,7 +232,7 @@ * Remove debian/pycompat (not needed due to cdbs). * Remove debian/pyversions. * Add XS-Python-Version to debian/control, set to >= 2.4 - * debian/preinst: + * debian/preinst: - Added to avoid directory/symlink conflict due to the new Python policy. -- Gustavo Franco Tue, 19 Sep 2006 11:26:02 -0300 @@ -203,7 +251,7 @@ -- Adeodato Simó Wed, 13 Sep 2006 20:10:51 +0200 bzrtools (0.9.0-1) unstable; urgency=low - + [ Mohammed Adnène Trojette ] * New upstream release and resync with Ubuntu. * debian/control: @@ -243,9 +291,9 @@ - Set Utnubu Team as Maintainer - Standards-Version bumped up to 3.7.2 - Move cdbs and debhelper to Build-Depends field - + -- Gustavo Franco Sat, 20 May 2006 11:51:30 -0300 - + bzrtools (0.7-2) unstable; urgency=low * debian/control: Now suggests python2.4-paramiko diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/debian/control /tmp/tEYJNCx3jI/bzrtools-1.11.0/debian/control --- bzrtools-1.6.0/debian/control 2009-02-02 11:36:16.000000000 +0000 +++ bzrtools-1.11.0/debian/control 2009-02-02 11:36:16.000000000 +0000 @@ -2,9 +2,9 @@ Section: devel Priority: optional Maintainer: Debian Bazaar Maintainers -Uploaders: Gustavo Franco , Arnaud Fontaine , Reinhard Tartler , Adeodato Simó , Jelmer Vernooij -Build-Depends: cdbs, debhelper, quilt, python, python-central -Build-Depends-Indep: bzr (>= 1.6~), rsync +Uploaders: Gustavo Franco , Arnaud Fontaine , Reinhard Tartler , Adeodato Simó , Jelmer Vernooij +Build-Depends: cdbs, debhelper, python, python-central +Build-Depends-Indep: bzr (>= 1.9~), rsync Vcs-Bzr: http://bzr.debian.org/pkg-bazaar/bzrtools/unstable Homepage: http://bazaar-vcs.org/BzrTools Standards-Version: 3.8.0 @@ -13,7 +13,7 @@ Package: bzrtools Architecture: all -Depends: ${python:Depends}, bzr (>= 1.6~), bzr (<< 1.7~), patch +Depends: ${python:Depends}, bzr (>= 1.11~), bzr (<< 1.12~), patch, ${misc:Depends} Recommends: rsync, graphviz Suggests: librsvg2-bin XB-Python-Version: ${python:Versions} @@ -26,7 +26,6 @@ bzrtools actually includes: * rspush: Push local changes to a remote server using rsync instead sftp. - * shelve/unshelve: Provide a fine-grained 'undo' facility. * clean-tree: Remove unknown, ignored-junk, or all unversioned files from the current tree. * graph-ancestry: Use graphviz to produce graphs of branch ancestry. diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/debian/rules /tmp/tEYJNCx3jI/bzrtools-1.11.0/debian/rules --- bzrtools-1.6.0/debian/rules 2009-02-02 11:36:16.000000000 +0000 +++ bzrtools-1.11.0/debian/rules 2009-02-02 11:36:16.000000000 +0000 @@ -5,12 +5,9 @@ include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/python-distutils.mk -include /usr/share/cdbs/1/rules/patchsys-quilt.mk DEB_INSTALL_DOCS_ALL += CREDITS NEWS.Shelf README.Shelf TODO.Shelf -DEB_QUILT_PATCHDIR_LINK := quilt_patches # patches exists in the tarball - ifneq (,$(findstring test,$(DEB_BUILD_OPTIONS))) common-post-build-indep:: env BZR_PLUGIN_PATH=$(CURDIR)/build/lib/bzrlib/plugins \ diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/graph.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/graph.py --- bzrtools-1.6.0/graph.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/graph.py 2009-01-12 13:57:15.000000000 +0000 @@ -20,7 +20,7 @@ from bzrlib.branch import Branch from bzrlib.errors import BzrCommandError, NoSuchRevision -from bzrlib.graph import node_distances, select_farthest +from bzrlib.deprecated_graph import node_distances, select_farthest from bzrlib.revision import NULL_REVISION from bzrtools import short_committer diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/__init__.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/__init__.py --- bzrtools-1.6.0/__init__.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/__init__.py 2009-01-12 13:57:15.000000000 +0000 @@ -1,6 +1,4 @@ -# Copyright (C) 2005, 2006, 2007 Aaron Bentley -# Copyright (C) 2005, 2006 Canonical Limited. -# Copyright (C) 2006 Michael Ellerman. +# Copyright (C) 2008 Aaron Bentley. # # 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 @@ -17,604 +15,56 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """\ -Various useful plugins for working with bzr. +Various useful commands for working with bzr. """ -import bzrlib +from bzrlib import ignores, option +from bzrlib.commands import plugin_cmds +from version import version_info, __version__ -from bzrlib.lazy_import import lazy_import -lazy_import(globals(), """ -from bzrlib import help, urlutils -import shelf -""") -from version import version_info, __version__ -from command import BzrToolsCommand -from errors import CommandError -from patchsource import BzrPatchSource -import sys -import os.path - -import bzrlib.builtins -import bzrlib.commands -from bzrlib.branch import Branch -from bzrlib.bzrdir import BzrDir -from bzrlib.commands import get_cmd_object -from bzrlib.errors import BzrCommandError -import bzrlib.ignores -from bzrlib.trace import note -from bzrlib.option import Option - -from command import BzrToolsCommand - -bzrlib.ignores.add_runtime_ignores(['./.shelf']) - - -class cmd_clean_tree(BzrToolsCommand): - """Remove unwanted files from working tree. - - By default, only unknown files, not ignored files, are deleted. Versioned - files are never deleted. - - Another class is 'detritus', which includes files emitted by bzr during - normal operations and selftests. (The value of these files decreases with - time.) - - If no options are specified, unknown files are deleted. Otherwise, option - flags are respected, and may be combined. - - To check what clean-tree will do, use --dry-run. - """ - takes_options = [Option('ignored', help='Delete all ignored files.'), - Option('detritus', help='Delete conflict files, merge' - ' backups, and failed selftest dirs.'), - Option('unknown', - help='Delete files unknown to bzr (default).'), - Option('dry-run', help='Show files to delete instead of' - ' deleting them.')] - def run(self, unknown=False, ignored=False, detritus=False, dry_run=False): - from clean_tree import clean_tree - if not (unknown or ignored or detritus): - unknown = True - clean_tree('.', unknown=unknown, ignored=ignored, detritus=detritus, - dry_run=dry_run) - - -class cmd_graph_ancestry(BzrToolsCommand): - """Produce ancestry graphs using dot. - - Output format is detected according to file extension. Some of the more - common output formats are html, png, gif, svg, ps. An extension of '.dot' - will cause a dot graph file to be produced. HTML output has mouseovers - that show the commit message. - - Branches are labeled r?, where ? is the revno. If they have no revno, - with the last 5 characters of their revision identifier are used instead. - - The value starting with d is "(maximum) distance from the null revision". - - If --merge-branch is specified, the two branches are compared and a merge - base is selected. - - Legend: - white normal revision - yellow THIS history - red OTHER history - orange COMMON history - blue COMMON non-history ancestor - green Merge base (COMMON ancestor farthest from the null revision) - dotted Ghost revision (missing from branch storage) - - Ancestry is usually collapsed by skipping revisions with a single parent - and descendant. The number of skipped revisions is shown on the arrow. - This feature can be disabled with --no-collapse. - - By default, revisions are ordered by distance from root, but they can be - clustered instead using --cluster. - - If available, rsvg is used to antialias PNG and JPEG output, but this can - be disabled with --no-antialias. - """ - takes_args = ['file', 'merge_branch?'] - takes_options = [Option('no-collapse', help="Do not skip simple nodes."), - Option('no-antialias', - help="Do not use rsvg to produce antialiased output."), - Option('merge-branch', type=str, - help="Use this branch to calcuate a merge base."), - Option('cluster', help="Use clustered output."), - Option('max-distance', - help="Show no nodes farther than this.", type=int), - Option('directory', - help='Source branch to use (default is current' - ' directory).', - short_name='d', - type=unicode), - ] - def run(self, file, merge_branch=None, no_collapse=False, - no_antialias=False, cluster=False, max_distance=100, - directory='.'): - if max_distance == -1: - max_distance = None - import graph - if cluster: - ranking = "cluster" - else: - ranking = "forced" - graph.write_ancestry_file(directory, file, not no_collapse, - not no_antialias, merge_branch, ranking, - max_distance=max_distance) - - -class cmd_fetch_ghosts(BzrToolsCommand): - """Attempt to retrieve ghosts from another branch. - If the other branch is not supplied, the last-pulled branch is used. - """ - aliases = ['fetch-missing'] - takes_args = ['branch?'] - takes_options = [Option('no-fix', help="Skip additional synchonization.")] - def run(self, branch=None, no_fix=False): - from fetch_ghosts import fetch_ghosts - fetch_ghosts(branch, no_fix) - -strip_help="""Strip the smallest prefix containing num leading slashes from \ -each file name found in the patch file.""" - - -class cmd_patch(BzrToolsCommand): - """Apply a named patch to the current tree. - """ - takes_args = ['filename?'] - takes_options = [Option('strip', type=int, help=strip_help), - Option('silent', help='Suppress chatter.')] - def run(self, filename=None, strip=None, silent=False): - from patch import patch - from bzrlib.workingtree import WorkingTree - wt = WorkingTree.open_containing('.')[0] - if strip is None: - strip = 0 - return patch(wt, filename, strip, silent) - - -class cmd_shelve(BzrToolsCommand): - """Temporarily set aside some changes from the current tree. - - Shelve allows you to temporarily put changes you've made "on the shelf", - ie. out of the way, until a later time when you can bring them back from - the shelf with the 'unshelve' command. - - Shelve is intended to help separate several sets of text changes that have - been inappropriately mingled. If you just want to get rid of all changes - (text and otherwise) and you don't need to restore them later, use revert. - If you want to shelve all text changes at once, use shelve --all. - - By default shelve asks you what you want to shelve, press '?' at the - prompt to get help. To shelve everything run shelve --all. - - If filenames are specified, only the changes to those files will be - shelved, other files will be left untouched. - - If a revision is specified, changes since that revision will be shelved. - - You can put multiple items on the shelf. Normally each time you run - unshelve the most recently shelved changes will be reinstated. However, - you can also unshelve changes in a different order by explicitly - specifiying which changes to unshelve. This works best when the changes - don't depend on each other. - - While you have patches on the shelf you can view and manipulate them with - the 'shelf' command. Run 'bzr shelf -h' for more info. - """ - - takes_args = ['file*'] - takes_options = [Option('message', - help='A message to associate with the shelved changes.', - short_name='m', type=unicode), - 'revision', - Option('all', help='Shelve all changes without prompting.'), - Option('no-color', help='Never display changes in color.')] - - def run(self, all=False, file_list=None, message=None, revision=None, - no_color=False): - if revision is not None and revision: - if len(revision) == 1: - revision = revision[0] - else: - raise CommandError("shelve only accepts a single revision " - "parameter.") - - source = BzrPatchSource(revision, file_list) - s = shelf.Shelf(source.base) - s.shelve(source, all, message, no_color) - return 0 - - -# The following classes are only used as subcommands for 'shelf', they're -# not to be registered directly with bzr. - -class cmd_shelf_list(bzrlib.commands.Command): - """List the patches on the current shelf.""" - aliases = ['list', 'ls'] - def run(self): - self.shelf.list() - - -class cmd_shelf_delete(bzrlib.commands.Command): - """Delete the patch from the current shelf.""" - aliases = ['delete', 'del'] - takes_args = ['patch'] - def run(self, patch): - self.shelf.delete(patch) - - -class cmd_shelf_switch(bzrlib.commands.Command): - """Switch to the other shelf, create it if necessary.""" - aliases = ['switch'] - takes_args = ['othershelf'] - def run(self, othershelf): - s = shelf.Shelf(self.shelf.base, othershelf) - s.make_default() - - -class cmd_shelf_show(bzrlib.commands.Command): - """Show the contents of the specified or topmost patch.""" - aliases = ['show', 'cat', 'display'] - takes_args = ['patch?'] - def run(self, patch=None): - self.shelf.display(patch) - - -class cmd_shelf_upgrade(bzrlib.commands.Command): - """Upgrade old format shelves.""" - aliases = ['upgrade'] - def run(self): - self.shelf.upgrade() - - -class cmd_shelf(BzrToolsCommand): - """Perform various operations on your shelved patches. See also shelve.""" - takes_args = ['subcommand', 'args*'] - - subcommands = [cmd_shelf_list, cmd_shelf_delete, cmd_shelf_switch, - cmd_shelf_show, cmd_shelf_upgrade] - - def run(self, subcommand, args_list): - import sys - - if args_list is None: - args_list = [] - cmd = self._get_cmd_object(subcommand) - source = BzrPatchSource() - s = shelf.Shelf(source.base) - cmd.shelf = s - - if args_list is None: - args_list = [] - return cmd.run_argv_aliases(args_list) - - def _get_cmd_object(self, cmd_name): - for cmd_class in self.subcommands: - for alias in cmd_class.aliases: - if alias == cmd_name: - return cmd_class() - raise CommandError("Unknown shelf subcommand '%s'" % cmd_name) - - def help(self): - text = ["%s\n\nSubcommands:\n" % self.__doc__] - - for cmd_class in self.subcommands: - text.extend(self.sub_help(cmd_class) + ['\n']) - - return ''.join(text) - - def sub_help(self, cmd_class): - text = [] - cmd_obj = cmd_class() - indent = 2 * ' ' - - usage = cmd_obj._usage() - usage = usage.replace('bzr shelf-', '') - text.append('%s%s\n' % (indent, usage)) - - text.append('%s%s\n' % (2 * indent, cmd_class.__doc__)) - - # Somewhat copied from bzrlib.help.help_on_command_options - option_help = [] - for option_name, option in sorted(cmd_obj.options().items()): - if option_name == 'help': - continue - option_help.append('%s--%s' % (3 * indent, option_name)) - if option.type is not None: - option_help.append(' %s' % option.argname.upper()) - if option.short_name(): - option_help.append(', -%s' % option.short_name()) - option_help.append('%s%s\n' % (2 * indent, option.help)) - - if len(option_help) > 0: - text.append('%soptions:\n' % (2 * indent)) - text.extend(option_help) - - return text - - -class cmd_unshelve(BzrToolsCommand): - """Restore shelved changes. - - By default the most recently shelved changes are restored. However if you - specify a patch by name those changes will be restored instead. - - See 'shelve' for more information. - """ - takes_options = [ - Option('all', help='Unshelve all changes without prompting.'), - Option('force', help='Force unshelving even if errors occur.'), - Option('no-color', help='Never display changes in color.') - ] - takes_args = ['patch?'] - def run(self, patch=None, all=False, force=False, no_color=False): - source = BzrPatchSource() - s = shelf.Shelf(source.base) - s.unshelve(source, patch, all, force, no_color) - return 0 - - -class cmd_shell(BzrToolsCommand): - """Begin an interactive shell tailored for bzr. - Bzr commands can be used without typing bzr first, and will be run natively - when possible. Tab completion is tailored for bzr. The shell prompt shows - the branch nick, revno, and path. - - If it encounters any moderately complicated shell command, it will punt to - the system shell. - - Example: - $ bzr shell - bzr bzrtools:287/> status - modified: - __init__.py - bzr bzrtools:287/> status --[TAB][TAB] - --all --help --revision --show-ids - bzr bzrtools:287/> status -- - """ - def run(self): - import shell - return shell.run_shell() - - -class cmd_branch_history(BzrToolsCommand): - """\ - Display the development history of a branch. - - Each different committer or branch nick is considered a different line of - development. Committers are treated as the same if they have the same - name, or if they have the same email address. - """ - takes_args = ["branch?"] - def run(self, branch=None): - from branchhistory import branch_history - return branch_history(branch) - - -class cmd_zap(BzrToolsCommand): - """\ - Remove a lightweight checkout, if it can be done safely. - - This command will remove a lightweight checkout without losing data. That - means it only removes lightweight checkouts, and only if they have no - uncommitted changes. - - If --branch is specified, the branch will be deleted too, but only if the - the branch has no new commits (relative to its parent). - """ - takes_options = [Option("branch", help="Remove associated branch from" - " repository."), - Option('force', help='Delete tree even if contents are' - ' modified.')] - takes_args = ["checkout"] - def run(self, checkout, branch=False, force=False): - from zap import zap - return zap(checkout, remove_branch=branch, allow_modified=force) - - -class cmd_cbranch(BzrToolsCommand): - """ - Create a new checkout, associated with a new repository branch. - - When you cbranch, bzr looks up a target location in locations.conf, and - creates the branch there. - - In your locations.conf, add the following lines: - [/working_directory_root] - cbranch_target = /branch_root - cbranch_target:policy = appendpath - - This will mean that if you run "bzr cbranch foo/bar foo/baz" in the - working directory root, the branch will be created in - "/branch_root/foo/baz" - - NOTE: cbranch also supports "cbranch_root", but that behaviour is - deprecated. - """ - takes_options = [Option("lightweight", - help="Create a lightweight checkout."), 'revision', - Option('files-from', type=unicode, - help='Accelerate checkout using files from this' - ' tree.'), - Option('hardlink', - help='Hard-link files from source/files-from tree' - ' where posible.')] - takes_args = ["source", "target?"] - def run(self, source, target=None, lightweight=False, revision=None, - files_from=None, hardlink=False): - from cbranch import cbranch - return cbranch(source, target, lightweight=lightweight, - revision=revision, files_from=files_from, - hardlink=hardlink) - - -class cmd_branches(BzrToolsCommand): - """Scan a location for branches""" - takes_args = ["location?"] - def run(self, location=None): - from branches import branches - return branches(location) - -class cmd_trees(BzrToolsCommand): - """Scan a location for trees""" - takes_args = ['location?'] - def run(self, location='.'): - from bzrlib.workingtree import WorkingTree - from bzrlib.transport import get_transport - t = get_transport(location) - for tree in WorkingTree.find_trees(location): - self.outf.write('%s\n' % t.relpath( - tree.bzrdir.root_transport.base)) - -class cmd_multi_pull(BzrToolsCommand): - """Pull all the branches under a location, e.g. a repository. - - Both branches present in the directory and the branches of checkouts are - pulled. - """ - takes_args = ["location?"] - def run(self, location=None): - from bzrlib.transport import get_transport - from bzrtools import iter_branch_tree - if location is None: - location = '.' - t = get_transport(location) - possible_transports = [] - if not t.listable(): - print "Can't list this type of location." - return 3 - for branch, wt in iter_branch_tree(t): - if wt is None: - pullable = branch - else: - pullable = wt - parent = branch.get_parent() - if parent is None: - continue - if wt is not None: - base = wt.basedir - else: - base = branch.base - if base.startswith(t.base): - relpath = base[len(t.base):].rstrip('/') - else: - relpath = base - print "Pulling %s from %s" % (relpath, parent) - try: - branch_t = get_transport(parent, possible_transports) - pullable.pull(Branch.open_from_transport(branch_t)) - except Exception, e: - print e - - - -class cmd_import(BzrToolsCommand): - """Import sources from a directory, tarball or zip file - - This command will import a directory, tarball or zip file into a bzr - tree, replacing any versioned files already present. If a directory is - specified, it is used as the target. If the directory does not exist, or - is not versioned, it is created. - - Tarballs may be gzip or bzip2 compressed. This is autodetected. - - If the tarball or zip has a single root directory, that directory is - stripped when extracting the tarball. This is not done for directories. - """ - - takes_args = ['source', 'tree?'] - def run(self, source, tree=None): - from upstream_import import do_import - do_import(source, tree) - - -class cmd_cdiff(BzrToolsCommand): - """A color version of bzr's diff""" - takes_args = property(lambda x: get_cmd_object('diff').takes_args) - takes_options = list(get_cmd_object('diff').takes_options) + [ - Option('check-style', - help='Warn if trailing whitespace or spurious changes have been' - ' added.')] - - def run(self, check_style=False, *args, **kwargs): - from colordiff import colordiff - colordiff(check_style, *args, **kwargs) - - -class cmd_rspush(BzrToolsCommand): - """Upload this branch to another location using rsync. - - If no location is specified, the last-used location will be used. To - prevent dirty trees from being uploaded, rspush will error out if there are - unknown files or local changes. It will also error out if the upstream - directory is non-empty and not an earlier version of the branch. - """ - takes_args = ['location?'] - takes_options = [Option('overwrite', help='Ignore differences between' - ' branches and overwrite unconditionally.'), - Option('no-tree', help='Do not push the working tree,' - ' just the .bzr.')] - - def run(self, location=None, overwrite=False, no_tree=False): - from bzrlib import workingtree - import bzrtools - cur_branch = workingtree.WorkingTree.open_containing(".")[0] - bzrtools.rspush(cur_branch, location, overwrite=overwrite, - working_tree=not no_tree) - - -class cmd_link_tree(BzrToolsCommand): - """Hardlink matching files to another tree. - - Only files with identical content and execute bit will be linked. - """ - takes_args = ['location'] - - def run(self, location): - from bzrlib import workingtree - from bzrlib.plugins.bzrtools.link_tree import link_tree - target_tree = workingtree.WorkingTree.open_containing(".")[0] - source_tree = workingtree.WorkingTree.open(location) - target_tree.lock_write() - try: - source_tree.lock_read() - try: - link_tree(target_tree, source_tree) - finally: - source_tree.unlock() - finally: - target_tree.unlock() - -from heads import cmd_heads -commands = [ - cmd_branches, - cmd_branch_history, - cmd_cbranch, - cmd_cdiff, - cmd_clean_tree, - cmd_fetch_ghosts, - cmd_graph_ancestry, - cmd_heads, - cmd_import, - cmd_link_tree, - cmd_multi_pull, - cmd_patch, - cmd_rspush, - cmd_shelf, - cmd_shell, - cmd_shelve, - cmd_trees, - cmd_unshelve, - cmd_zap, - ] - - -if hasattr(bzrlib.commands, 'register_command'): - for command in commands: - bzrlib.commands.register_command(command) +ignores.add_runtime_ignores(['./.shelf']) + + +commands = { + 'cmd_branches': [], + 'cmd_branch_history': [], + 'cmd_cbranch': [], + 'cmd_cdiff': [], + 'cmd_clean_tree': [], + 'cmd_fetch_ghosts': ['fetch-missing'], + 'cmd_graph_ancestry': [], + 'cmd_import': [], + 'cmd_link_tree': [], + 'cmd_multi_pull': [], + 'cmd_patch': [], + 'cmd_rspush': [], + 'cmd_shelf1': [], + 'cmd_shell': [], + 'cmd_shelve1': ['shelve'], + 'cmd_trees': [], + 'cmd_unshelve1': ['unshelve'], + 'cmd_zap': [], +} + + +for cmd_name, aliases in commands.items(): + plugin_cmds.register_lazy(cmd_name, aliases, + 'bzrlib.plugins.bzrtools.command_classes') + + +plugin_cmds.register_lazy('cmd_heads', [], 'bzrlib.plugins.bzrtools.heads') + + +option.diff_writer_registry.register_lazy( + 'auto-color', 'bzrlib.plugins.bzrtools.colordiff', 'auto_diff_writer', + 'Colorized diffs, if supported', +) +option.diff_writer_registry.register_lazy( + 'color', 'bzrlib.plugins.bzrtools.colordiff', 'DiffWriter', + 'Colorized diffs', +) +option.diff_writer_registry.default_key = 'auto-color' def test_suite(): diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/NEWS /tmp/tEYJNCx3jI/bzrtools-1.11.0/NEWS --- bzrtools-1.6.0/NEWS 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/NEWS 2009-01-12 13:57:15.000000000 +0000 @@ -1,3 +1,45 @@ +January 12 2009 +* RELEASE: bzrtools 1.11.0 + +January 7 2009 +* Rename shelf command to shelf1, to match others & reduce confusion. + +November 28 2008 +* RELEASE: bzrtools 1.10.0 + +Novemeber 23 2008 +* Support auto-detecting or disabling color in cdiff (Benoît Pierre) +* Support auto-detecting color in shelf UI + +November 11 2008 +* Support colorizing in shelf UI + +November 5 2008 +* RELEASE: bzrtools 1.9.1 + +November 4 2008 +* Restore runtime ignore for .shelf files + +November 3 2008 +* RELEASE: bzrtools 1.9.0 + +October 22 2008 +* Use lazy command registration (changes bzr rocks 0.496 => 0.461). + +October 17 2008 +* Rename shelve and unshelve to shelve1 and unshelve1, with aliases to 'shelve' + and 'unshelve'. This allows bzr core to supply 'shelve' and 'unshelve'. + +October 7 2008 +* RELEASE: bzrtools 1.8.0 +* Fix NotStandalone class to be stringable (#277652) + +September 11 2008 +* RELEASE: bzrtools 1.7.0 + +July 10 2008 +* colordiff can now use /etc/colordiffrc + June 5 2008 * RELEASE: bzrtools 1.6.0 @@ -155,160 +197,160 @@ your working directory hierarchy exactly. New config option must be used: "cbranch_target". Appendpath policy should be used for this. -Dec 28 +Dec 28 2006 * 'import' command now honours execute bit in tarfiles -Dec 21 +Dec 21 2006 * 'graph-ancestry' shows branch nick if applicable -Dec 19 +Dec 19 2006 * 'patch' works over sftp (and, in theory, all transports) -Dec 13 +Dec 13 2006 * 'branch-history' tolerates commit ids with no email -Dec 12 +Dec 12 2006 * Add zip support to 'import' command -Dec 11 +Dec 11 2006 * 'patch' fixed to work properly with http URLs and all other transports -Dec 5 +Dec 5 2006 * 'rspush' supports dedicated rsync servers (i.e. site:: syntax) (Andrew Tridgell) -Dec 4 +Dec 4 2006 * 'shelf' handles pipe errors better when invoking patch -Nov 27 +Nov 27 2006 * RELEASE: bzrtools 0.13.0 -Nov 22 +Nov 22 2006 * Add encoding flag for 'baz-import' * Fix deprecated API use in 'switch' * Add show-paths command from Alexander Belchenko -Oct 25 +Oct 25 2006 * RELEASE: bzrtools 0.12.0 * Update 'import' command for unique roots changes -Oct 24 +Oct 24 2006 * Fix parent-setting in 'cbranch'. -Oct 15 +Oct 15 2006 * Update for unique roots changes -Sep 25 +Sep 25 2006 * RELEASE: bzrtools 0.11.0 * Remove Shove * Clean up test suite -Aug 28 +Aug 28 2006 * Shove is now deprecated * Reduce interactive slowdown by late-loading PyBaz -* baz-import speedup: remove useless merge_innter call +* baz-import speedup: remove useless merge_inner call -Aug 15 +Aug 15 2006 * Check bzrlib version * RELEASE: bzrtools 0.9.1 -Aug 11 +Aug 11 2006 * RELEASE: bzrtools 0.9.0 -Aug 6 +Aug 6 2006 * Add --no-color option to shelve/unshelve -July 13 +July 13 2006 * clean-tree no longer treats --detritus or --ignored as including --unknowns -July 11 +July 11 2006 * Shelf colorizing -June 14 +June 14 2006 * Add 'shove' command, to move changes to a different tree -June 3 +June 3 2006 * clean-tree tweaks -May 30 +May 30 2006 * test suite updates -May 18 +May 18 2006 * Add 'import' command, to import tarballs -May 11 +May 11 2006 * RELEASE: bzrtools 0.8.1 * Fixed test case failure -May 9 +May 9 2006 * RELEASE: bzrtools 0.8 -May 1 +May 1 2006 * Renamed push to rspush (Robert Collins/Aaron Bentley) -Apr 11 +Apr 11 2006 * New Switch command (David Allouche/Canonical) -Mar 22 +Mar 22 2006 * New Zap command -Mar 18 +Mar 18 2006 * Updates to Shelf command -Mar 10 +Mar 10 2006 * New baz-import algorithm, with respository support -Jan 31 +Jan 31 2006 * RELEASE: bzrtools 0.7 * Improved shell completion * bzr push can omit working tree * Documentation updates -Dec 13 +Dec 13 2005 * New test.py for standalone (kinda) testing * New branch-history command * New "fix" command (done automatically in fetch-ghosts) -Nov 8 +Nov 8 2005 * Various API updates * Added force-reweave-inventory from Daniel Silverstone * Decorated push from Robert Collins * Improved shell completion * Improved import when first ancestor is in an unregisered archive -Oct 28 +Oct 28 2005 * Added tests for several commands * Made push auto_disable when native push present * Merged Michael Ellerman's shelf v2 plugin * New "shell" command, derived from Fai * Got pull working with URLs -Oct 19 +Oct 19 2005 * Added setup.py * disabled annotate in favor of bzr annotate * Added clean-tree --detrius * API sync with bzr -Oct 14 +Oct 14 2005 * Default-ignore shelf files * Win32 compatability fixes (Alexander Belchenko) * Conflict handling now in bzr itself * Fetch-missing renamed to fetch-ghosts * Annotate includes changes since last commit, uses sha1 instead of text_id -Sept 29 +Sept 29 2005 * better errors for bad push locations (Eirik Nygaard) * prevented push from overwriting any non-empty directory that is not an ancestor branch. (Remote revision-history must be a subset of local.) * added --overwrite option to push -Sept 22 +Sept 22 2005 * Significant reworking of graph-ancestry * Fetch-missing uses 'parent' instead of 'x-pull' (bzr changed) * Updated to match bzr 0.0.8 API changes * Updated to handle new bzr diff output -Sept 13 +Sept 13 2005 * documented clean-tree, conflicts, resolve, graph-ancestry, patch * obsoleted all the executibles; bzrtools only works as plugins now diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/patch.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/patch.py --- bzrtools-1.6.0/patch.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/patch.py 2009-01-12 13:57:15.000000000 +0000 @@ -35,7 +35,7 @@ def run_patch(directory, patches, strip=0, reverse=False, dry_run=False, - quiet=False, _patch_cmd='patch'): + quiet=False, _patch_cmd='patch', target_file=None): args = [_patch_cmd, '-d', directory, '-s', '-p%d' % strip, '-f'] if quiet: args.append('--quiet') @@ -53,6 +53,8 @@ stderr = subprocess.PIPE else: stderr = None + if target_file is not None: + args.append(target_file) try: process = subprocess.Popen(args, stdin=subprocess.PIPE, diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/release.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/release.py --- bzrtools-1.6.0/release.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/release.py 2009-01-12 13:57:15.000000000 +0000 @@ -21,7 +21,7 @@ sys.exit(1) else: print "NEWS entry found" -final_name = '../bzrtools-%s.tar.gz' % bzrtools.__version__ +final_name = '../bzrtools-release/bzrtools-%s.tar.gz' % bzrtools.__version__ if os.path.exists('../bzrtools.tar.gz'): print "Temp file exists already." sys.exit(1) diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/terminal.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/terminal.py --- bzrtools-1.6.0/terminal.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/terminal.py 2009-01-12 13:57:15.000000000 +0000 @@ -27,6 +27,8 @@ # XXX See terminfo(5) for all the gory details. if sys.platform == "win32": return False + if not sys.stdout.isatty(): + return False import curses try: curses.setupterm() diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/tests/blackbox.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/tests/blackbox.py --- bzrtools-1.6.0/tests/blackbox.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/tests/blackbox.py 2009-01-12 13:57:15.000000000 +0000 @@ -21,23 +21,23 @@ self.touch('name~') assert os.path.lexists('name~') self.touch('name.pyc') - self.run_bzr('clean-tree') + self.run_bzr('clean-tree --force') assert os.path.lexists('name~') assert not os.path.lexists('name') self.touch('name') - self.run_bzr('clean-tree --detritus') + self.run_bzr('clean-tree --detritus --force') assert os.path.lexists('name') assert not os.path.lexists('name~') assert os.path.lexists('name.pyc') - self.run_bzr('clean-tree --ignored') + self.run_bzr('clean-tree --ignored --force') assert os.path.lexists('name') assert not os.path.lexists('name.pyc') - self.run_bzr('clean-tree --unknown') + self.run_bzr('clean-tree --unknown --force') assert not os.path.lexists('name') self.touch('name') self.touch('name~') self.touch('name.pyc') - self.run_bzr('clean-tree --unknown --ignored') + self.run_bzr('clean-tree --unknown --ignored --force') assert not os.path.lexists('name') assert not os.path.lexists('name~') assert not os.path.lexists('name.pyc') @@ -45,11 +45,11 @@ def test_shelve(self): self.run_bzr('init') self.run_bzr('commit -m uc --unchanged') - self.run_bzr('shelve -r 1 -m foo --all', retcode=3) + self.run_bzr('shelve1 -r 1 -m foo --all', retcode=3) file('foo', 'wb').write('foo') self.run_bzr('add foo') self.run_bzr('commit -m foo') - self.run_bzr('shelve -r 1 -m foo --all', retcode=0) + self.run_bzr('shelve1 -r 1 -m foo --all', retcode=0) def test_fetch_ghosts(self): self.run_bzr('init') diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/tests/clean_tree.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/tests/clean_tree.py --- bzrtools-1.6.0/tests/clean_tree.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/tests/clean_tree.py 2009-01-12 13:57:15.000000000 +0000 @@ -36,7 +36,7 @@ assert os.path.exists('branch/die-please') os.mkdir('no-die-please/child') - clean_tree('branch', unknown=True) + clean_tree('branch', unknown=True, no_prompt=True) assert os.path.exists('no-die-please') assert os.path.exists('no-die-please/child') diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/tests/shelf_tests.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/tests/shelf_tests.py --- bzrtools-1.6.0/tests/shelf_tests.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/tests/shelf_tests.py 2009-01-12 13:57:15.000000000 +0000 @@ -7,7 +7,7 @@ UnshelveHunkSelector, ) from bzrlib.plugins.bzrtools.errors import NoColor -from bzrlib.plugins.bzrtools import cmd_shelf +from bzrlib.plugins.bzrtools.command_classes import cmd_shelf1 class ShelfTests(bzrlib.tests.TestCaseWithTransport): @@ -95,7 +95,7 @@ self.tree.unlock() # Shelve the changes - self.run_bzr('shelve --all', retcode=0) + self.run_bzr('shelve1 --all', retcode=0) # Make sure there is no diff anymore self.assertEqual(self.run_bzr('diff', retcode=0)[0], '') @@ -106,7 +106,7 @@ self._check_shelf('00', new_date=new_date) # Unshelve - self.run_bzr('unshelve --all', retcode=0) + self.run_bzr('unshelve1 --all', retcode=0) self._check_diff() @@ -122,7 +122,7 @@ self.__create_and_add_test_file() # Shelve the changes - self.run_bzr('shelve --all', retcode=3) + self.run_bzr('shelve1 --all', retcode=3) if os.path.exists(os.path.join(self.tree.branch.base, '.shelf/shelves/default/00')): @@ -146,7 +146,7 @@ self.tree.commit(message='update test_file') # Shelve the changes - self.run_bzr('shelve --all -r 1', retcode=0) + self.run_bzr('shelve1 --all -r 1', retcode=0) self._check_diff(self.DIFF_2) @@ -154,7 +154,7 @@ self.assertEqual(file('test_file').read(), self.ORIGINAL) # Unshelve - self.run_bzr('unshelve --all', retcode=0) + self.run_bzr('unshelve1 --all', retcode=0) # Make sure the file is back the way it should be self.assertEqual(file('test_file').read(), self.MODIFIED) @@ -162,7 +162,7 @@ def test_shelf_with_two_revisions(self): self.tree = self.make_branch_and_tree('.') - stdout, stderr = self.run_bzr('shelve --all -r 1..2', retcode=None) + stdout, stderr = self.run_bzr('shelve1 --all -r 1..2', retcode=None) self.assertEqual(stderr.split('\n')[0], 'bzr: ERROR: shelve only accepts a single revision parameter.') @@ -177,7 +177,7 @@ self.build_tree_contents([('test_file', 'patch %s\n' % patch)]) # Shelve the changes - self.run_bzr('shelve --all', retcode=0) + self.run_bzr('shelve1 --all', retcode=0) # Make sure there is no diff anymore self.assertEqual(self.run_bzr('diff', retcode=0)[0], '') @@ -188,7 +188,7 @@ self.assertTrue('patch %s' % patch in shelf) # Check the shown output is right - shown = self.run_bzr('shelf show %s' % patch, retcode=0)[0] + shown = self.run_bzr('shelf1 show %s' % patch, retcode=0)[0] self.assertEqual(shown, shelf) def test_shelf_show_multi(self): @@ -204,7 +204,7 @@ self.assertTrue('patch 00' in shelf) # Check the shown output is right - shown = self.run_bzr('shelf show 00', retcode=0)[0] + shown = self.run_bzr('shelf1 show 00', retcode=0)[0] self.assertEqual(shown, shelf) def test_shelf_show_unspecified(self): @@ -220,12 +220,12 @@ self.assertTrue('patch 02' in shelf) # Check the shown output is right - shown = self.run_bzr('shelf show', retcode=0)[0] + shown = self.run_bzr('shelf1 show', retcode=0)[0] self.assertEqual(shown, shelf) def test_shelf_show_with_no_patch(self): self.tree = self.make_branch_and_tree('.') - stderr = self.run_bzr('shelf show 00', retcode=None)[1] + stderr = self.run_bzr('shelf1 show 00', retcode=None)[1] self.assertTrue("Patch '00' doesn't exist on shelf default!" in stderr) def test_shelf_unshelve_failure(self): @@ -237,7 +237,7 @@ file('test_file', 'w').write(self.MODIFIED) # Shelve the changes - self.run_bzr('shelve --all', retcode=0) + self.run_bzr('shelve1 --all', retcode=0) # Write an unapplyable patch into the shelf shelf = open(os.path.join(self.tree.basedir, @@ -246,7 +246,7 @@ shelf.close() # Unshelve, should fail - self.run_bzr('unshelve --all', retcode=3) + self.run_bzr('unshelve1 --all', retcode=3) # Make sure the patch is still there, eventhough it's broken shelf = open(os.path.join(self.tree.basedir, @@ -268,21 +268,21 @@ file('test_file2', 'w').write(self.MODIFIED) # Shelve the changes - self.run_bzr('shelve --all', retcode=0) + self.run_bzr('shelve1 --all', retcode=0) # Put the changes to test_file back, the shelved patch won't apply now file('test_file', 'w').write(self.MODIFIED) self.tree.commit(message='screw up test_file') # Unshelve, should fail - self.run_bzr('unshelve --all', retcode=3) + self.run_bzr('unshelve1 --all', retcode=3) # Working tree should be unchanged diff = self.run_bzr('diff', retcode=0)[0] self.assertEqual(diff, '') # Force should succeed and modify test_file2, but leave shelf - self.run_bzr('unshelve --force --all', retcode=0) + self.run_bzr('unshelve1 --force --all', retcode=0) self.assertEqual(open('test_file2').read(), self.MODIFIED) self.assertTrue(os.path.exists('.shelf/shelves/default/00')) @@ -297,23 +297,23 @@ file('test_file2', 'w').write(self.MODIFIED) # Shelve the changes - self.run_bzr('shelve --all test_file', retcode=0) - self.run_bzr('shelve --all test_file2', retcode=0) + self.run_bzr('shelve1 --all test_file', retcode=0) + self.run_bzr('shelve1 --all test_file2', retcode=0) # Unshelve - self.run_bzr('unshelve --all', retcode=0) + self.run_bzr('unshelve1 --all', retcode=0) # We should now have 00 and 01~ self.assertTrue(os.path.exists('.shelf/shelves/default/00')) self.assertTrue(os.path.exists('.shelf/shelves/default/01~')) # Check ls works - lines = self.run_bzr('shelf ls', retcode=0)[0].split('\n') + lines = self.run_bzr('shelf1 ls', retcode=0)[0].split('\n') for line in lines: self.assertFalse(line.startswith(' 01')) # Unshelve, if unshelve is confused by the backup it will fail - self.run_bzr('unshelve --all', retcode=0) + self.run_bzr('unshelve1 --all', retcode=0) def test_shelf_delete(self): self.tree = self.make_branch_and_tree('.') @@ -336,13 +336,13 @@ self.tree.unlock() # Shelve the changes - self.run_bzr('shelve --all test_file', retcode=0) - self.run_bzr('shelve --all test_file2', retcode=0) + self.run_bzr('shelve1 --all test_file', retcode=0) + self.run_bzr('shelve1 --all test_file2', retcode=0) self._check_shelf('00', new_date=new_date) # Delete 00 - self.run_bzr('shelf delete 00', retcode=0) + self.run_bzr('shelf1 delete 00', retcode=0) # We should now have 01 but not 00, but we should have 00~ self.assertFalse(os.path.exists('.shelf/shelves/default/00')) @@ -353,28 +353,28 @@ self._check_shelf('00~', new_date=new_date) # Check ls works - lines = self.run_bzr('shelf ls', retcode=0)[0].split('\n') + lines = self.run_bzr('shelf1 ls', retcode=0)[0].split('\n') for line in lines: self.assertFalse(line.startswith(' 00')) # Unshelve should unshelve 01 - self.run_bzr('unshelve --all', retcode=0) + self.run_bzr('unshelve1 --all', retcode=0) self.assertEqual(file('test_file2').read(), self.MODIFIED) def test_shelf_gaps(self): self.tree = self.make_branch_and_tree('.') self.__create_and_add_test_file() file('test_file', 'w').write(self.MODIFIED) - self.run_bzr('shelve --all test_file', retcode=0) + self.run_bzr('shelve1 --all test_file', retcode=0) file('test_file', 'w').write(self.MODIFIED) - self.run_bzr('shelve --all test_file', retcode=0) + self.run_bzr('shelve1 --all test_file', retcode=0) # Now delete 00, leaving 01, next shelve should go into 02 - self.run_bzr('shelf delete 0', retcode=0) + self.run_bzr('shelf1 delete 0', retcode=0) self.assertFalse(os.path.exists('.shelf/shelves/default/00')) self.assertFalse(os.path.exists('.shelf/shelves/default/02')) file('test_file', 'w').write(self.MODIFIED) - self.run_bzr('shelve --all test_file', retcode=0) + self.run_bzr('shelve1 --all test_file', retcode=0) self.assertFalse(os.path.exists('.shelf/shelves/default/00')) self.assertTrue(os.path.exists('.shelf/shelves/default/02')) @@ -385,7 +385,7 @@ # Modify then shelve, so we're not upgrading to 00, just for kicks file('test_file', 'w').write(self.MODIFIED) - self.run_bzr('shelve --all test_file', retcode=0) + self.run_bzr('shelve1 --all test_file', retcode=0) open('.bzr-shelf', 'w').write('First old shelf') open('.bzr-shelf-1', 'w').write('Second old shelf') @@ -393,14 +393,14 @@ # shelve and unshelve should bitch and do nothing file('test_file', 'w').write('blah blah blah') - self.run_bzr('shelve --all', retcode=3) + self.run_bzr('shelve1 --all', retcode=3) self.assertFalse(os.path.exists('.shelf/shelves/default/01')) self.assertEqual(file('test_file').read(), 'blah blah blah') - self.run_bzr('unshelve --all', retcode=3) + self.run_bzr('unshelve1 --all', retcode=3) self.assertTrue(os.path.exists('.shelf/shelves/default/00')) # Upgrade, make sure it worked - self.run_bzr('shelf upgrade', retcode=0) + self.run_bzr('shelf1 upgrade', retcode=0) self.assertEqual(open('.shelf/shelves/default/01').read(), 'First old shelf') self.assertEqual(open('.shelf/shelves/default/02').read(), @@ -417,7 +417,7 @@ self.assertFalse(os.path.exists('.bzr-shelf-3')) # Shelve should work now - self.run_bzr('shelve --all', retcode=0) + self.run_bzr('shelve1 --all', retcode=0) def test_shelf_p1_patch(self): self.tree = self.make_branch_and_tree('.') @@ -425,7 +425,7 @@ self.__create_and_add_test_file() # Run a benign shelf command to setup .shelf for us - self.run_bzr('shelf ls', retcode=0) + self.run_bzr('shelf1 ls', retcode=0) old_tree = self.tree.basis_tree() old_tree.lock_read() @@ -447,7 +447,7 @@ open('.shelf/shelves/default/00', 'w').write(diff) # This should work - self.run_bzr('unshelve --all', retcode=0) + self.run_bzr('unshelve1 --all', retcode=0) self._check_diff() @@ -468,23 +468,23 @@ f.close() # Shelve the changes - self.run_bzr('shelve --all', retcode=0) + self.run_bzr('shelve1 --all', retcode=0) # Working tree should be unchanged diff = self.run_bzr('diff', retcode=0)[0] self.assertEqual(diff, '') # Unshelve, should succeed - self.run_bzr('unshelve --all', retcode=0) + self.run_bzr('unshelve1 --all', retcode=0) self._check_diff(filename='subdir/test_file') # Make sure relative filenames work ok - self.run_bzr('shelve test_file --all', retcode=0) + self.run_bzr('shelve1 test_file --all', retcode=0) def test_shelf_shelf_bogus_subcommand(self): self.tree = self.make_branch_and_tree('.') - self.run_bzr('shelf foo', retcode=3) # <- retcode == 3 + self.run_bzr('shelf1 foo', retcode=3) # <- retcode == 3 def test_shelf_OOO_unshelve(self): self.tree = self.make_branch_and_tree('.') @@ -498,7 +498,7 @@ # Shelve the changes for i in range(1, 5): - self.run_bzr(['shelve', '--all', 'test_file%d' % i], retcode=0) + self.run_bzr(['shelve1', '--all', 'test_file%d' % i], retcode=0) # Check shelving worked for i in range(1, 5): @@ -509,31 +509,31 @@ self.assertTrue(os.path.exists('.shelf/shelves/default/0%d' % i)) # Unshelve 00 - self.run_bzr('unshelve --all 00', retcode=0) + self.run_bzr('unshelve1 --all 00', retcode=0) self.assertEqual(file('test_file1').read(), self.MODIFIED) # Check ls works - lines = self.run_bzr('shelf ls', retcode=0)[0].split('\n') + lines = self.run_bzr('shelf1 ls', retcode=0)[0].split('\n') for line in lines: self.assertFalse(line.startswith(' 00')) # Check we can reshelve once we've unshelved out of order, should be 04 self.assertFalse(os.path.exists('.shelf/shelves/default/04')) - self.run_bzr('shelve --all') + self.run_bzr('shelve1 --all') self.assertTrue(os.path.exists('.shelf/shelves/default/04')) # Check ls works - text = self.run_bzr('shelf ls', retcode=0)[0] + text = self.run_bzr('shelf1 ls', retcode=0)[0] for line in text.split('\n'): self.assertFalse(line.startswith(' 00')) # We now have 01,02,03,04 # Unshelve 02 - self.run_bzr('unshelve --all 02', retcode=0) + self.run_bzr('unshelve1 --all 02', retcode=0) self.assertEqual(file('test_file3').read(), self.MODIFIED) # Unshelve the default, this is the reshelved 00, hence modifies file 1 - self.run_bzr('unshelve --all', retcode=0) + self.run_bzr('unshelve1 --all', retcode=0) self.assertEqual(file('test_file1').read(), self.MODIFIED) def test_shelf_switch_basic(self): @@ -542,12 +542,12 @@ # This should go to "default" file('test_file', 'w').write(self.MODIFIED) - self.run_bzr('shelve --all test_file', retcode=0) + self.run_bzr('shelve1 --all test_file', retcode=0) # Switch to "other" - self.run_bzr('shelf switch other', retcode=0) + self.run_bzr('shelf1 switch other', retcode=0) file('test_file', 'w').write(self.MODIFIED) - self.run_bzr('shelve --all test_file', retcode=0) + self.run_bzr('shelve1 --all test_file', retcode=0) # Check it worked self.assertTrue(os.path.exists('.shelf/shelves/default/00')) @@ -555,9 +555,9 @@ self.assertTrue(os.path.exists('.shelf/shelves/other/00')) # Switch back - self.run_bzr('shelf switch default', retcode=0) + self.run_bzr('shelf1 switch default', retcode=0) file('test_file', 'w').write(self.MODIFIED) - self.run_bzr('shelve --all test_file', retcode=0) + self.run_bzr('shelve1 --all test_file', retcode=0) # Check that worked self.assertTrue(os.path.exists('.shelf/shelves/default/01')) @@ -567,20 +567,20 @@ self.tree = self.make_branch_and_tree('.') self.build_tree_contents([('file', '\x00')]) self.tree.add('file') - self.run_bzr_error(['Changes involve binary files.'], 'shelve --all') + self.run_bzr_error(['Changes involve binary files.'], 'shelve1 --all') def test_shelf_bad_patch_arg(self): self.tree = self.make_branch_and_tree('.') # Check the bad arg handling - stdout, error = self.run_bzr('unshelve 01', retcode=3) + stdout, error = self.run_bzr('unshelve1 01', retcode=3) self.assertTrue("Patch '01' doesn't exist on shelf" in error) - stdout, error = self.run_bzr('unshelve foo', retcode=3) + stdout, error = self.run_bzr('unshelve1 foo', retcode=3) self.assertTrue("Invalid patch name 'foo'" in error) # Hex and is cracky, so it shouldn't work - stdout, error = self.run_bzr(['unshelve', '0x00'], retcode=3) + stdout, error = self.run_bzr(['unshelve1', '0x00'], retcode=3) self.assertTrue("Invalid patch name '0x00'" in error) def test_color_hunk_selector(self): @@ -618,13 +618,13 @@ f = file('test_file', 'wb') f.write(self.MODIFIED) f.close() - stdout, error = self.run_bzr('shelve --all --no-color') - stdout, error = self.run_bzr('unshelve --all --no-color') + stdout, error = self.run_bzr('shelve1 --all --no-color') + stdout, error = self.run_bzr('unshelve1 --all --no-color') def test_shelf_help(self): - self.assertContainsRe(cmd_shelf().help(), + self.assertContainsRe(cmd_shelf1().help(), 'list\n.*List the patches on the current shelf') def test_show_empty_shelf(self): self.tree = self.make_branch_and_tree('.') - self.run_bzr_error(('No patches on shelf.',), 'shelf show') + self.run_bzr_error(('No patches on shelf.',), 'shelf1 show') diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/tests/test_rspush.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/tests/test_rspush.py --- bzrtools-1.6.0/tests/test_rspush.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/tests/test_rspush.py 2009-01-12 13:57:15.000000000 +0000 @@ -72,8 +72,9 @@ checkout = branch.create_checkout('checkout', lightweight=True) checkout.commit('some changes') mock_rsync = MockRSync() - self.assertRaises(NotStandalone, rspush, checkout, 'example.org:foo', - _rsync=mock_rsync) + e = self.assertRaises(NotStandalone, rspush, checkout, + 'example.org:foo', _rsync=mock_rsync) + self.assertContainsRe(str(e), '/checkout/ is not a standalone tree.$') def test_refuse_checkout(self): branch = self.make_branch('tree') diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/userinteractor.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/userinteractor.py --- bzrtools-1.6.0/userinteractor.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/userinteractor.py 2009-01-12 13:57:15.000000000 +0000 @@ -1,4 +1,6 @@ import sys +from bzrlib.osutils import getchar + class UserOption: def __init__(self, char, action, help, default=False): @@ -111,7 +113,7 @@ sys.stdout.write(opt.char) sys.stdout.write('?] (%s): ' % default.char) - response = self.__getchar() + response = getchar() # default, which we see as newline, is 'n' if response in ['\n', '\r', '\r\n']: @@ -130,20 +132,3 @@ def __show_help(self): for opt in self._options: print ' %s - %s' % (opt.char, opt.help) - - if sys.platform == "win32": - def __getchar(self): - import msvcrt - return msvcrt.getch() - else: - def __getchar(self): - import tty - import termios - fd = sys.stdin.fileno() - settings = termios.tcgetattr(fd) - try: - tty.setraw(fd) - ch = sys.stdin.read(1) - finally: - termios.tcsetattr(fd, termios.TCSADRAIN, settings) - return ch diff -Nru /tmp/UXy5a7v5Tf/bzrtools-1.6.0/version.py /tmp/tEYJNCx3jI/bzrtools-1.11.0/version.py --- bzrtools-1.6.0/version.py 2008-06-06 03:33:02.000000000 +0100 +++ bzrtools-1.11.0/version.py 2009-01-12 13:57:15.000000000 +0000 @@ -1,2 +1,2 @@ -__version__ = '1.6.0' +__version__ = '1.11.0' version_info = tuple(int(n) for n in __version__.split('.'))