358
358
# --no-strict overrides --strict
359
359
self.run_bzr('commit', '--strict', '-m', 'add b', '--no-strict',
360
360
working_dir='tree')
362
def test_fixes_bug_output(self):
363
"""commit --fixes=lp:23452 succeeds without output."""
365
self.build_tree(['hello.txt'])
366
self.runbzr('add hello.txt')
367
output = self.capture('commit -m hello --fixes=lp:23452 hello.txt')
368
self.assertEqual('', output)
370
def test_fixes_bug_sets_property(self):
371
"""commit --fixes=lp:23452 sets the lp:23452 revprop to 'fixed'."""
372
tree = self.make_branch_and_tree('tree')
373
self.build_tree(['tree/hello.txt'])
374
tree.add('hello.txt')
375
self.runbzr('commit -m hello --fixes=lp:23452 tree/hello.txt')
377
# Get the revision properties, ignoring the branch-nick property, which
378
# we don't care about for this test.
379
last_rev = tree.branch.repository.get_revision(tree.last_revision())
380
properties = dict(last_rev.properties)
381
del properties['branch-nick']
383
self.assertEqual({'lp:23452': 'fixed'}, properties)
385
def test_fixes_multiple_bugs_sets_properties(self):
386
"""--fixes can be used more than once to show that bugs are fixed."""
387
tree = self.make_branch_and_tree('tree')
388
self.build_tree(['tree/hello.txt'])
389
tree.add('hello.txt')
391
'commit -m hello --fixes=lp:123 --fixes=lp:235 tree/hello.txt')
393
# Get the revision properties, ignoring the branch-nick property, which
394
# we don't care about for this test.
395
last_rev = tree.branch.repository.get_revision(tree.last_revision())
396
properties = dict(last_rev.properties)
397
del properties['branch-nick']
399
self.assertEqual({'lp:123': 'fixed', 'lp:235': 'fixed'}, properties)