PQM

Merge lp:~jelmer/pqm/avoid-rev-history into lp:pqm

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 241
Proposed branch: lp:~jelmer/pqm/avoid-rev-history
Merge into: lp:pqm
Diff against target: 48 lines (+6/-6)
2 files modified
docs/design.txt (+2/-1)
pqm/__init__.py (+4/-5)
To merge this branch: bzr merge lp:~jelmer/pqm/avoid-rev-history
Reviewer Review Type Date Requested Status
Martin Pool (community) Approve
pqm developers Pending
Review via email: mp+79672@code.launchpad.net

Commit message

Avoid using Branch.revision_history() and Branch.set_revision_history().

Description of the change

Use Branch.set_last_revision_info / Branch.last_revision_info rather than Branch.set_revision_history / Branch.revision_history, which are deprecated.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

  vote approve

review: Approve
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks!

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Can somebody merge this for me?

Revision history for this message
Robert Collins (lifeless) wrote :

I get test failures with this applied :(.

FTW I get test failures without it applied as well. So I'm going to
merge it, but it could be bust.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/design.txt'
2--- docs/design.txt 2007-11-04 18:04:49 +0000
3+++ docs/design.txt 2011-10-18 11:39:26 +0000
4@@ -31,7 +31,8 @@
5 # the pqm will be such that the most recent commit will not be visible to
6 # other users until publication, so as to prevent race conditions with the
7 # uncommit facility.
8- parent.set_revision_history(parent.revision_history()[:-1])
9+ (last_revno, last_revid) = branch.last_revision_info()
10+ branch.set_last_revision_info(old_last_revno, old_last_revid)
11 # Merge two branches:
12 other = bzrlib.branch.Branch.open(SOURCE)
13 conflicts = tree.merge_from_branch(other)
14
15=== modified file 'pqm/__init__.py'
16--- pqm/__init__.py 2010-06-10 00:45:07 +0000
17+++ pqm/__init__.py 2011-10-18 11:39:26 +0000
18@@ -403,6 +403,7 @@
19 # this equality tests for 'not a checkout'
20 if tree.bzrdir.root_transport.base == branch.bzrdir.root_transport.base:
21 parent_branch = Branch.open(parent_branch)
22+ (old_revno, old_revid) = parent_branch.last_revision_info()
23 branch.push(parent_branch)
24 logger.info("commited '%s' to '%s'", branch, parent_branch)
25 output.append("commited '%s' to '%s'" % (branch, parent_branch))
26@@ -416,8 +417,7 @@
27 except (bzrlib.errors.BzrError, bzrlib.errors.BzrNewError), e:
28 # Discard the successfully committed item from the 'master'
29 # branch.
30- parent_branch.set_revision_history(
31- parent_branch.revision_history()[:-1])
32+ parent_branch.set_last_revision_info(old_revno, old_revid)
33 raise PQMTlaFailure(sender, [str(e).split('\n')])
34 return output
35
36@@ -465,10 +465,9 @@
37 raise PQMTlaFailure(sender, [])
38 _merge_tags_if_possible(merger.other_branch, tree.branch)
39 output_obj.add_stdout("Merge successful.")
40-
41+
42 def make_local_dir(self, sender, branch_spec, output_dir):
43- from bzrlib.branch import Branch, BranchReferenceFormat
44- import bzrlib.bzrdir as bzrdir
45+ from bzrlib.branch import Branch
46 os.mkdir(output_dir)
47 branch = Branch.open(branch_spec)
48 branch.create_checkout(output_dir, lightweight=True)

Subscribers

People subscribed via source and target branches

to status/vote changes: