Merge lp://qastaging/~abentley/bzrtools/testattach into lp://qastaging/bzrtools

Proposed by Aaron Bentley
Status: Rejected
Rejected by: Aaron Bentley
Proposed branch: lp://qastaging/~abentley/bzrtools/testattach
Merge into: lp://qastaging/bzrtools
Diff against target: 134 lines (+37/-10)
4 files modified
README (+2/-0)
bzrtools.py (+12/-1)
version.py (+1/-1)
zap.py (+22/-8)
To merge this branch: bzr merge lp://qastaging/~abentley/bzrtools/testattach
Reviewer Review Type Date Requested Status
Aaron Bentley Pending
Review via email: mp+193415@code.qastaging.launchpad.net

Commit message

test

Description of the change

This is a test of attaching files to comments.

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Test of attachment.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlJyVdsACgkQ0F+nu1YWqI3dFQCfbE8sXX/Ozd05Aeb3vFZUqOCx
/vgAn3aBaQRMhwz69j3NZhARZ3uqrR/Y
=7FGZ
-----END PGP SIGNATURE-----

Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Test.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlJyZAsACgkQ0F+nu1YWqI03HACdGaAWtKktGOyIfzJs91t3LMGf
EPcAnjkj8q2fI0jtibO39D+O7hPUnjXD
=cyF7
-----END PGP SIGNATURE-----

=== modified file 'README'
--- README 2009-03-11 02:13:43 +0000
+++ README 2013-10-31 13:02:36 +0000
@@ -1,3 +1,5 @@
1TEST
2
1BZR TOOLS3BZR TOOLS
24
3This is is a set of plugins for Bazaar.5This is is a set of plugins for Bazaar.
46
=== modified file 'bzrtools.py'
--- bzrtools.py 2012-01-20 02:05:50 +0000
+++ bzrtools.py 2013-08-20 03:02:23 +0000
@@ -1,4 +1,4 @@
1# Copyright (C) 2005-2009, 2011-2012 Aaron Bentley <aaron@aaronbentley.com>1# Copyright (C) 2005-2009, 2011-2013 Aaron Bentley <aaron@aaronbentley.com>
2# Copyright (C) 2007 John Arbash Meinel2# Copyright (C) 2007 John Arbash Meinel
3#3#
4# This program is free software; you can redistribute it and/or modify4# This program is free software; you can redistribute it and/or modify
@@ -14,6 +14,7 @@
14# You should have received a copy of the GNU General Public License14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17from contextlib import contextmanager
17import re18import re
1819
19from bzrlib import urlutils20from bzrlib import urlutils
@@ -26,6 +27,16 @@
26from bzrlib.transport import get_transport27from bzrlib.transport import get_transport
2728
2829
30@contextmanager
31def read_locked(lockable):
32 """Read-lock a tree, branch or repository in this context."""
33 lockable.lock_read()
34 try:
35 yield lockable
36 finally:
37 lockable.unlock()
38
39
29def short_committer(committer):40def short_committer(committer):
30 new_committer = re.sub('<.*>', '', committer).strip(' ')41 new_committer = re.sub('<.*>', '', committer).strip(' ')
31 if len(new_committer) < 2:42 if len(new_committer) < 2:
3243
=== modified file 'version.py'
--- version.py 2012-01-20 02:07:15 +0000
+++ version.py 2013-08-20 02:19:06 +0000
@@ -75,5 +75,5 @@
75 return main_version + sub_string75 return main_version + sub_string
7676
7777
78version_info = (2, 5, 0)78version_info = (2, 6, 0)
79__version__ = _format_version_tuple(version_info)79__version__ = _format_version_tuple(version_info)
8080
=== modified file 'zap.py'
--- zap.py 2011-04-12 04:51:37 +0000
+++ zap.py 2013-08-20 03:00:56 +0000
@@ -1,4 +1,5 @@
1# Copyright (C) 2006-2007, 2010-2011 Aaron Bentley <aaron@aaronbentley.com>1# Copyright (C) 2006-2007, 2010-2011 Aaron Bentley <aaron@aaronbentley.com>
2# Copyright (C) 2013 Aaron Bentley <aaron@aaronbentley.com>
2# Copyright (C) 2007 Charlie Shepherd <masterdriverz@gentoo.org>3# Copyright (C) 2007 Charlie Shepherd <masterdriverz@gentoo.org>
3# Copyright (C) 2011 Canonical Ltd.4# Copyright (C) 2011 Canonical Ltd.
4#5#
@@ -29,6 +30,7 @@
2930
30from errors import (NotCheckout, UncommittedCheckout, ParentMissingRevisions,31from errors import (NotCheckout, UncommittedCheckout, ParentMissingRevisions,
31 NoParent)32 NoParent)
33from bzrlib.plugins.bzrtools.bzrtools import read_locked
3234
3335
34class AllowChanged(object):36class AllowChanged(object):
@@ -83,6 +85,7 @@
83change_policy_registry.default_key = 'check'85change_policy_registry.default_key = 'check'
8486
8587
88
86def zap(path, remove_branch=False, policy=HaltOnChange):89def zap(path, remove_branch=False, policy=HaltOnChange):
87 try:90 try:
88 wt = bzrdir.BzrDir.open(path).open_workingtree(path,91 wt = bzrdir.BzrDir.open(path).open_workingtree(path,
@@ -99,12 +102,13 @@
99 parent_loc = branch.get_parent()102 parent_loc = branch.get_parent()
100 if parent_loc is None:103 if parent_loc is None:
101 raise NoParent()104 raise NoParent()
102 parent = Branch.open(parent_loc)105 with read_locked(Branch.open(parent_loc)) as parent:
103 last_revision = _mod_revision.ensure_null(parent.last_revision())106 last_revision = _mod_revision.ensure_null(parent.last_revision())
104 p_ancestry = parent.repository.get_ancestry(last_revision)107 if last_revision != _mod_revision.NULL_REVISION:
105 if (last_revision != _mod_revision.NULL_REVISION and108 graph = parent.repository.get_graph()
106 branch.last_revision() not in p_ancestry):109 heads = graph.heads([last_revision, branch.last_revision()])
107 raise ParentMissingRevisions(branch.get_parent())110 if branch.last_revision() in heads:
111 raise ParentMissingRevisions(branch.get_parent())
108 rmtree(path)112 rmtree(path)
109 if remove_branch:113 if remove_branch:
110 t = branch.bzrdir.transport114 t = branch.bzrdir.transport
@@ -118,7 +122,7 @@
118 import os122 import os
119 from unittest import makeSuite123 from unittest import makeSuite
120124
121 from bzrlib.tests import TestCaseInTempDir125 from bzrlib.tests import TestCaseWithTransport
122126
123127
124 class PipelinePluginFeature:128 class PipelinePluginFeature:
@@ -133,7 +137,7 @@
133 return True137 return True
134138
135139
136 class TestZap(TestCaseInTempDir):140 class TestZap(TestCaseWithTransport):
137141
138 def make_checkout(self):142 def make_checkout(self):
139 wt = bzrdir.BzrDir.create_standalone_workingtree('source')143 wt = bzrdir.BzrDir.create_standalone_workingtree('source')
@@ -209,4 +213,14 @@
209 checkout.branch.set_parent(branch.base)213 checkout.branch.set_parent(branch.base)
210 zap('checkout', policy=StoreChanges, remove_branch=True)214 zap('checkout', policy=StoreChanges, remove_branch=True)
211215
216 def test_zap_branch_with_unique_revision(self):
217 parent = self.make_branch_and_tree('parent')
218 parent.commit('foo')
219 new_branch = self.make_branch('new')
220 new_branch.set_parent(parent.branch.base)
221 checkout = new_branch.create_checkout('checkout', lightweight=True)
222 checkout.commit('unique')
223 self.assertRaises(ParentMissingRevisions, zap, 'checkout',
224 remove_branch=True)
225
212 return makeSuite(TestZap)226 return makeSuite(TestZap)

Unmerged revisions

788. By Aaron Bentley

Test commit.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches