Merge lp://qastaging/~spiv/bzr/tags-commit-propagation-603395-2.2 into lp://qastaging/bzr/2.2

Proposed by Andrew Bennetts
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 5109
Proposed branch: lp://qastaging/~spiv/bzr/tags-commit-propagation-603395-2.2
Merge into: lp://qastaging/bzr/2.2
Diff against target: 144 lines (+73/-11)
3 files modified
NEWS (+5/-1)
bzrlib/commit.py (+12/-1)
bzrlib/tests/blackbox/test_tags.py (+56/-9)
To merge this branch: bzr merge lp://qastaging/~spiv/bzr/tags-commit-propagation-603395-2.2
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
John A Meinel Needs Fixing
Review via email: mp+39733@code.qastaging.launchpad.net

Commit message

Make 'bzr commit' in a checkout propagate new tags to the master (and report conflicting tags). (#603395)

Description of the change

This is the second part of the fix for bug 603395. It makes commit in a checkout try to merge tags to the master, so that tags introduced by e.g. "bzr merge" will be propagated to the master.

This patch <https://code.launchpad.net/~spiv/bzr/checkout-tags-propagation-603395-2.2/+merge/39732>. I have been thinking of them as separate changes, but depending on how the discussion on the other branch goes they should perhaps be combined (the tests do pass when combined, including the tests for builddeb). Regardless of the outcome of the other patch I think the blackbox tests this adds are valuable, as they represent a reasonable use case.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

I think having the news entry saying it propagates "new" tags is misleading. It propagates all tags. (Imagine the master deleted a tag, we'll put it back at this point.)

Anyway the change seems fine, though it seems like it would supersede the other. (rather than have it done at merge time, have it done at commit time seems a better tradeoff. Would be even better if we staged tag changes into the working tree, rather than auto-committing to the branch.)

So, I like this patch more than the other one, just needs a tweak on the NEWS entry.

review: Needs Fixing
Revision history for this message
Martin Packman (gz) wrote :

If I merge this branch with trunk, both new tests fail due to script test output now having to be specified:

Traceback (most recent call last):
  ...
  File "C:\bzr\bzr\tags-commit-propagation-603395-2.2\bzrlib\tests\blackbox\test_tags.py", line 140, in test_commit_in_heavyweight_checkout_copies_tags_to_master
    """)
  File "C:\bzr\bzr\tags-commit-propagation-603395-2.2\bzrlib\tests\script.py", line 514, in run_script
    return ScriptRunner().run_script(test_case, script_string)
  File "C:\bzr\bzr\tags-commit-propagation-603395-2.2\bzrlib\tests\script.py", line 209, in run_script
    self.run_command(test_case, cmd, input, output, error)
  File "C:\bzr\bzr\tags-commit-propagation-603395-2.2\bzrlib\tests\script.py", line 228, in run_command
    raise AssertionError(str(e) + " in stdout of command %s" % cmd)
AssertionError: texts not equal:
+ Created a standalone tree (format: 2a)
 in stdout of command ['bzr', 'init', 'master']

Don't really like the duplication of the setup steps either, it's hard enough to read already without this block twice:

+ $ bzr init master
+ $ cd master
+ $ bzr commit -m "Initial commit." --unchanged
+ $ cd ..
+ $ bzr checkout master child
+ $ bzr branch master fork
+ $ cd fork
+ $ bzr commit -m "Commit in fork." --unchanged
+ $ bzr tag new-tag

review: Needs Fixing
Revision history for this message
Andrew Bennetts (spiv) wrote :

mgz: Heh, I agree about the duplication... so much so that I'd already done something about it, but I'd forgotten to push! Have pushed now. Please take another look and let me know what you think. Some assertions have been moved out of run_script too, to innoculate against future changes in the command output that are irrelevant to the purpose of the tests.

I'm happy to take care of tweaking the run_script invocation when merging up to trunk — with the much shorter run_script segments I have now that should be a pretty small change.

Revision history for this message
Martin Packman (gz) wrote :

Yup, I like the look of the assertions spelt like that.

review: Approve
Revision history for this message
Andrew Bennetts (spiv) wrote :

sent to pqm by email

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