Rev 6179: Add script tests and documentation. in file:///home/vila/src/bzr/bugs/861472-migrate-log-format/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Fri Sep 30 14:28:48 UTC 2011
At file:///home/vila/src/bzr/bugs/861472-migrate-log-format/
------------------------------------------------------------
revno: 6179
revision-id: v.ladeuil+lp at free.fr-20110930142848-vjva0cr3l5rawzxn
parent: v.ladeuil+lp at free.fr-20110929164600-khu9gmvgm251x7lp
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 861472-migrate-log-format
timestamp: Fri 2011-09-30 16:28:48 +0200
message:
Add script tests and documentation.
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2011-09-27 13:58:50 +0000
+++ b/bzrlib/builtins.py 2011-09-30 14:28:48 +0000
@@ -985,6 +985,10 @@
location to use the default. To change the default, use --remember. The
value will only be saved if the remote location can be accessed.
+ The --verbose option will display the revisions pulled using the log_format
+ configuration option. You can use a different format by overriding it with
+ -Olog_format=<other_format>.
+
Note: The location can be specified either in the form of a branch,
or in the form of a path to a file containing a merge directive generated
with bzr send.
@@ -1120,6 +1124,10 @@
--no-remember to avoid setting it). After that, you can omit the
location to use the default. To change the default, use --remember. The
value will only be saved if the remote location can be accessed.
+
+ The --verbose option will display the revisions pushed using the log_format
+ configuration option. You can use a different format by overriding it with
+ -Olog_format=<other_format>.
"""
_see_also = ['pull', 'update', 'working-trees']
=== modified file 'bzrlib/tests/blackbox/test_pull.py'
--- a/bzrlib/tests/blackbox/test_pull.py 2011-09-26 00:00:44 +0000
+++ b/bzrlib/tests/blackbox/test_pull.py 2011-09-30 14:28:48 +0000
@@ -23,6 +23,7 @@
from bzrlib import (
debug,
remote,
+ tests,
urlutils,
)
@@ -31,13 +32,13 @@
from bzrlib.osutils import pathjoin
from bzrlib.tests import (
fixtures,
- TestCaseWithTransport,
+ script,
)
from bzrlib.uncommit import uncommit
from bzrlib.workingtree import WorkingTree
-class TestPull(TestCaseWithTransport):
+class TestPull(tests.TestCaseWithTransport):
def example_branch(self, path='.'):
tree = self.make_branch_and_tree(path)
@@ -422,7 +423,7 @@
self.assertLength(19, self.hpss_calls)
remote = Branch.open('stacked')
self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
-
+
def test_pull_cross_format_warning(self):
"""You get a warning for probably slow cross-format pulls.
"""
@@ -553,3 +554,30 @@
out = self.run_bzr(['pull', '--overwrite', '-d', 'to', 'from'])
self.assertEqual(out,
('No revisions or tags to pull.\n', ''))
+
+
+class TestPullOutput(script.TestCaseWithTransportAndScript):
+
+ def test_pull_log_format(self):
+ self.run_script("""
+ $ bzr init trunk
+ Created a standalone tree (format: 2a)
+ $ cd trunk
+ $ echo foo > file
+ $ bzr add
+ adding file
+ $ bzr commit -m 'we need some foo'
+ 2>Committing to:...trunk/
+ 2>added file
+ 2>Committed revision 1.
+ $ cd ..
+ $ bzr init feature
+ Created a standalone tree (format: 2a)
+ $ cd feature
+ $ bzr pull -v ../trunk -Olog_format=line
+ Now on revision 1.
+ Added Revisions:
+ 1: jrandom at example.com ...we need some foo
+ 2>+N file
+ 2>All changes applied successfully.
+ """)
=== modified file 'bzrlib/tests/blackbox/test_push.py'
--- a/bzrlib/tests/blackbox/test_push.py 2011-09-22 12:13:12 +0000
+++ b/bzrlib/tests/blackbox/test_push.py 2011-09-30 14:28:48 +0000
@@ -35,6 +35,7 @@
blackbox,
http_server,
scenarios,
+ script,
test_foreign,
test_server,
)
@@ -842,3 +843,27 @@
self.assertEquals("", output)
self.assertEquals(error, "bzr: ERROR: It is not possible to losslessly"
" push to dummy. You may want to use dpush instead.\n")
+
+
+class TestPushOutput(script.TestCaseWithTransportAndScript):
+
+ def test_push_log_format(self):
+ self.run_script("""
+ $ bzr init trunk
+ Created a standalone tree (format: 2a)
+ $ cd trunk
+ $ echo foo > file
+ $ bzr add
+ adding file
+ $ bzr commit -m 'we need some foo'
+ 2>Committing to:...trunk/
+ 2>added file
+ 2>Committed revision 1.
+ $ bzr init ../feature
+ Created a standalone tree (format: 2a)
+ $ bzr push -v ../feature -Olog_format=line
+ Added Revisions:
+ 1: jrandom at example.com ...we need some foo
+ 2>All changes applied successfully.
+ 2>Pushed up to revision 1.
+ """)
=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt 2011-09-29 16:46:00 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt 2011-09-30 14:28:48 +0000
@@ -24,7 +24,7 @@
provides a value for a config option in the ``-Oname=value`` form that
takes precedence over all definitions found in config files. It can be
used multiple times to override different options.
- (Vincent Ladeuil, #491196, #861472)
+ (Vincent Ladeuil, #491196)
* ``bzr serve`` will now disconnect clients if they have not issued an RPC
request after 5minutes. On POSIX platforms, this will also happen for
@@ -35,6 +35,10 @@
finish the current request, and then close the connection.
(John Arbash Meinel, #824797, #795025)
+* The ``log_format`` configuration can be used with ``-Olog_format=line`` to
+ change the format ``push`` and ``pull`` use to display the
+ revisions. I.e.: ``bzr pull -v -Olog_format=short`` will use the ``short``
+ format instead of the default ``long`` one. (Vincent Ladeuil, #861472)
Improvements
************
=== modified file 'doc/en/whats-new/whats-new-in-2.5.txt'
--- a/doc/en/whats-new/whats-new-in-2.5.txt 2011-07-11 07:49:59 +0000
+++ b/doc/en/whats-new/whats-new-in-2.5.txt 2011-09-30 14:28:48 +0000
@@ -16,6 +16,18 @@
2.1, 2.2, 2.3 and 2.4, and can read and write repositories generated by all
previous versions.
+Overriding configuration options from the command line
+******************************************************
+
+The ``-O`` parameter available for all bzr commands allows a user to
+override a configuration option from the command line. For example::
+
+ bzr pull -v -Olog_format=line
+
+will change the way the pulled revisions are displayed (the default log
+format is ``long``.
+
+
Further information
*******************
More information about the bazaar-commits
mailing list