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
=== modified file 'docs/design.txt'
--- docs/design.txt 2007-11-04 18:04:49 +0000
+++ docs/design.txt 2011-10-18 11:39:26 +0000
@@ -31,7 +31,8 @@
31 # the pqm will be such that the most recent commit will not be visible to31 # the pqm will be such that the most recent commit will not be visible to
32 # other users until publication, so as to prevent race conditions with the32 # other users until publication, so as to prevent race conditions with the
33 # uncommit facility.33 # uncommit facility.
34 parent.set_revision_history(parent.revision_history()[:-1])34 (last_revno, last_revid) = branch.last_revision_info()
35 branch.set_last_revision_info(old_last_revno, old_last_revid)
35 # Merge two branches:36 # Merge two branches:
36 other = bzrlib.branch.Branch.open(SOURCE)37 other = bzrlib.branch.Branch.open(SOURCE)
37 conflicts = tree.merge_from_branch(other)38 conflicts = tree.merge_from_branch(other)
3839
=== modified file 'pqm/__init__.py'
--- pqm/__init__.py 2010-06-10 00:45:07 +0000
+++ pqm/__init__.py 2011-10-18 11:39:26 +0000
@@ -403,6 +403,7 @@
403 # this equality tests for 'not a checkout'403 # this equality tests for 'not a checkout'
404 if tree.bzrdir.root_transport.base == branch.bzrdir.root_transport.base:404 if tree.bzrdir.root_transport.base == branch.bzrdir.root_transport.base:
405 parent_branch = Branch.open(parent_branch)405 parent_branch = Branch.open(parent_branch)
406 (old_revno, old_revid) = parent_branch.last_revision_info()
406 branch.push(parent_branch)407 branch.push(parent_branch)
407 logger.info("commited '%s' to '%s'", branch, parent_branch)408 logger.info("commited '%s' to '%s'", branch, parent_branch)
408 output.append("commited '%s' to '%s'" % (branch, parent_branch))409 output.append("commited '%s' to '%s'" % (branch, parent_branch))
@@ -416,8 +417,7 @@
416 except (bzrlib.errors.BzrError, bzrlib.errors.BzrNewError), e:417 except (bzrlib.errors.BzrError, bzrlib.errors.BzrNewError), e:
417 # Discard the successfully committed item from the 'master'418 # Discard the successfully committed item from the 'master'
418 # branch.419 # branch.
419 parent_branch.set_revision_history(420 parent_branch.set_last_revision_info(old_revno, old_revid)
420 parent_branch.revision_history()[:-1])
421 raise PQMTlaFailure(sender, [str(e).split('\n')])421 raise PQMTlaFailure(sender, [str(e).split('\n')])
422 return output422 return output
423423
@@ -465,10 +465,9 @@
465 raise PQMTlaFailure(sender, [])465 raise PQMTlaFailure(sender, [])
466 _merge_tags_if_possible(merger.other_branch, tree.branch)466 _merge_tags_if_possible(merger.other_branch, tree.branch)
467 output_obj.add_stdout("Merge successful.")467 output_obj.add_stdout("Merge successful.")
468 468
469 def make_local_dir(self, sender, branch_spec, output_dir):469 def make_local_dir(self, sender, branch_spec, output_dir):
470 from bzrlib.branch import Branch, BranchReferenceFormat470 from bzrlib.branch import Branch
471 import bzrlib.bzrdir as bzrdir
472 os.mkdir(output_dir)471 os.mkdir(output_dir)
473 branch = Branch.open(branch_spec)472 branch = Branch.open(branch_spec)
474 branch.create_checkout(output_dir, lightweight=True)473 branch.create_checkout(output_dir, lightweight=True)

Subscribers

People subscribed via source and target branches

to status/vote changes: