25
25
from testtools.matchers import DocTestMatches
33
from ...controldir import ControlDir
33
from brzlib.controldir import ControlDir
34
from brzlib.tests import (
38
from .. import TestCaseWithTransport
39
from ..matchers import ContainsNoVfsCalls
40
from ..test_bedding import override_whoami
38
from brzlib.tests import TestCaseWithTransport
39
from brzlib.tests.matchers import ContainsNoVfsCalls
43
42
class TestCommit(TestCaseWithTransport):
47
46
# If forced, it should succeed, but this is not tested here.
48
47
self.make_branch_and_tree('.')
49
48
self.build_tree(['hello.txt'])
50
out, err = self.run_bzr('commit -m empty', retcode=3)
49
out,err = self.run_bzr('commit -m empty', retcode=3)
51
50
self.assertEqual('', out)
52
51
# Two ugly bits here.
53
52
# 1) We really don't want 'aborting commit write group' anymore.
54
# 2) brz: ERROR: is a really long line, so we wrap it with '\'
53
# 2) bzr: ERROR: is a really long line, so we wrap it with '\'
57
56
DocTestMatches("""\
59
brz: ERROR: No changes to commit.\
60
Please 'brz add' the files you want to commit,\
58
bzr: ERROR: No changes to commit.\
59
Please 'bzr add' the files you want to commit,\
61
60
or use --unchanged to force an empty commit.
62
""", flags=doctest.ELLIPSIS | doctest.REPORT_UDIFF))
61
""", flags=doctest.ELLIPSIS|doctest.REPORT_UDIFF))
64
63
def test_commit_success(self):
65
64
"""Successful commit should not leave behind a bzr-commit-* file"""
92
91
a_tree.add('a_file')
93
92
self.run_bzr(['commit', '-m', 'first commit', 'a'])
95
b_tree = a_tree.controldir.sprout('b').open_workingtree()
96
self.build_tree_contents([('b/a_file', b'changes in b')])
94
b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
95
self.build_tree_contents([('b/a_file', 'changes in b')])
97
96
self.run_bzr(['commit', '-m', 'first commit in b', 'b'])
99
self.build_tree_contents([('a/a_file', b'new contents')])
98
self.build_tree_contents([('a/a_file', 'new contents')])
100
99
self.run_bzr(['commit', '-m', 'change in a', 'a'])
102
101
b_tree.merge_from_branch(a_tree.branch)
127
126
def test_verbose_commit_modified(self):
128
127
# Verbose commit of modified file should say so
129
128
wt = self.prepare_simple_history()
130
self.build_tree_contents([('hello.txt', b'new contents')])
129
self.build_tree_contents([('hello.txt', 'new contents')])
131
130
out, err = self.run_bzr('commit -m modified')
132
131
self.assertEqual('', out)
133
132
self.assertContainsRe(err, '^Committing to: .*\n'
134
'modified hello\\.txt\n'
135
'Committed revision 2\\.\n$')
133
'modified hello\.txt\n'
134
'Committed revision 2\.\n$')
137
136
def test_unicode_commit_message_is_filename(self):
138
137
"""Unicode commit message same as a filename (Bug #563646).
140
139
self.requireFeature(features.UnicodeFilenameFeature)
141
140
file_name = u'\N{euro sign}'
142
141
self.run_bzr(['init'])
143
with open(file_name, 'w') as f:
144
f.write('hello world')
142
with open(file_name, 'w') as f: f.write('hello world')
145
143
self.run_bzr(['add'])
146
144
out, err = self.run_bzr(['commit', '-m', file_name])
147
reflags = re.MULTILINE | re.DOTALL | re.UNICODE
145
reflags = re.MULTILINE|re.DOTALL|re.UNICODE
148
146
te = osutils.get_terminal_encoding()
149
self.assertContainsRe(err,
150
u'The commit message is a file name:',
147
self.assertContainsRe(err.decode(te),
148
u'The commit message is a file name:',
153
151
# Run same test with a filename that causes encode
154
152
# error for the terminal encoding. We do this
160
158
osutils.get_terminal_encoding = lambda trace=None: 'ascii'
161
159
file_name = u'foo\u1234'
162
with open(file_name, 'w') as f:
163
f.write('hello world')
160
with open(file_name, 'w') as f: f.write('hello world')
164
161
self.run_bzr(['add'])
165
162
out, err = self.run_bzr(['commit', '-m', file_name])
166
reflags = re.MULTILINE | re.DOTALL | re.UNICODE
163
reflags = re.MULTILINE|re.DOTALL|re.UNICODE
167
164
te = osutils.get_terminal_encoding()
168
self.assertContainsRe(err,
169
u'The commit message is a file name:',
165
self.assertContainsRe(err.decode(te, 'replace'),
166
u'The commit message is a file name:',
172
169
osutils.get_terminal_encoding = default_get_terminal_enc
176
173
tree = self.make_branch_and_tree(".")
177
174
self.build_tree(["f"])
179
out, err = self.run_bzr_raw(["commit", "-m", "Wrong filename", u"\xa7"],
180
encoding="utf-8", retcode=3)
181
self.assertContainsRe(err, b"(?m)not versioned: \"\xc2\xa7\"$")
176
out, err = self.run_bzr(["commit", "-m", "Wrong filename", u"\xa7"],
177
encoding="utf-8", retcode=3)
178
self.assertContainsRe(err, "(?m)not versioned: \"\xc2\xa7\"$")
183
180
def test_non_ascii_file_unversioned_iso_8859_5(self):
184
181
self.requireFeature(features.UnicodeFilenameFeature)
185
182
tree = self.make_branch_and_tree(".")
186
183
self.build_tree(["f"])
188
out, err = self.run_bzr_raw(["commit", "-m", "Wrong filename", u"\xa7"],
189
encoding="iso-8859-5", retcode=3)
190
self.assertNotContainsString(err, b"\xc2\xa7")
191
self.assertContainsRe(err, b"(?m)not versioned: \"\xfd\"$")
185
out, err = self.run_bzr(["commit", "-m", "Wrong filename", u"\xa7"],
186
encoding="iso-8859-5", retcode=3)
187
self.expectFailure("Error messages are always written as UTF-8",
188
self.assertNotContainsString, err, "\xc2\xa7")
189
self.assertContainsRe(err, "(?m)not versioned: \"\xfd\"$")
193
191
def test_warn_about_forgotten_commit_message(self):
194
192
"""Test that the lack of -m parameter is caught"""
205
203
out, err = self.run_bzr('commit -m renamed')
206
204
self.assertEqual('', out)
207
205
self.assertContainsRe(err, '^Committing to: .*\n'
208
'renamed hello\\.txt => gutentag\\.txt\n'
209
'Committed revision 2\\.$\n')
206
'renamed hello\.txt => gutentag\.txt\n'
207
'Committed revision 2\.$\n')
211
209
def test_verbose_commit_moved(self):
212
210
# Verbose commit of file moved to new directory should say so
216
214
wt.rename_one('hello.txt', 'subdir/hello.txt')
217
215
out, err = self.run_bzr('commit -m renamed')
218
216
self.assertEqual('', out)
217
self.assertEqual(set([
220
218
'Committing to: %s/' % osutils.getcwd(),
222
220
'renamed hello.txt => subdir/hello.txt',
223
221
'Committed revision 2.',
225
}, set(err.split('\n')))
223
]), set(err.split('\n')))
227
225
def test_verbose_commit_with_unknown(self):
228
226
"""Unknown files should not be listed by default in verbose output"""
230
228
wt = ControlDir.create_standalone_workingtree('.')
231
229
self.build_tree(['hello.txt', 'extra.txt'])
232
230
wt.add(['hello.txt'])
233
out, err = self.run_bzr('commit -m added')
231
out,err = self.run_bzr('commit -m added')
234
232
self.assertEqual('', out)
235
233
self.assertContainsRe(err, '^Committing to: .*\n'
236
'added hello\\.txt\n'
237
'Committed revision 1\\.\n$')
235
'Committed revision 1\.\n$')
239
237
def test_verbose_commit_with_unchanged(self):
240
238
"""Unchanged files should not be listed by default in verbose output"""
243
241
tree.add('unchanged.txt')
244
242
self.run_bzr('commit -m unchanged unchanged.txt')
245
243
tree.add("hello.txt")
246
out, err = self.run_bzr('commit -m added')
244
out,err = self.run_bzr('commit -m added')
247
245
self.assertEqual('', out)
248
246
self.assertContainsRe(err, '^Committing to: .*\n'
249
'added hello\\.txt\n'
250
'Committed revision 2\\.$\n')
248
'Committed revision 2\.$\n')
252
250
def test_verbose_commit_includes_master_location(self):
253
251
"""Location of master is displayed when committing to bound branch"""
283
281
def test_commit_merge_reports_all_modified_files(self):
284
282
# the commit command should show all the files that are shown by
285
# brz diff or brz status when committing, even when they were not
283
# bzr diff or bzr status when committing, even when they were not
286
284
# changed by the user but rather through doing a merge.
287
285
this_tree = self.make_branch_and_tree('this')
288
286
# we need a bunch of files and dirs, to perform one action on each.
311
309
this_tree.commit('create_files')
312
other_dir = this_tree.controldir.sprout('other')
310
other_dir = this_tree.bzrdir.sprout('other')
313
311
other_tree = other_dir.open_workingtree()
314
with other_tree.lock_write():
315
# perform the needed actions on the files and dirs.
312
other_tree.lock_write()
313
# perform the needed actions on the files and dirs.
316
315
other_tree.rename_one('dirtorename', 'renameddir')
317
316
other_tree.rename_one('dirtoreparent', 'renameddir/reparenteddir')
318
317
other_tree.rename_one('filetorename', 'renamedfile')
321
320
other_tree.remove(['dirtoremove', 'filetoremove'])
322
321
self.build_tree_contents([
323
322
('other/newdir/',),
324
('other/filetomodify', b'new content'),
325
('other/newfile', b'new file content')])
323
('other/filetomodify', 'new content'),
324
('other/newfile', 'new file content')])
326
325
other_tree.add('newfile')
327
326
other_tree.add('newdir/')
328
327
other_tree.commit('modify all sample files and dirs.')
329
330
this_tree.merge_from_branch(other_tree.branch)
330
331
out, err = self.run_bzr('commit -m added', working_dir='this')
331
332
self.assertEqual('', out)
333
self.assertEqual(set([
333
334
'Committing to: %s/' % osutils.pathjoin(osutils.getcwd(), 'this'),
334
335
'modified filetomodify',
356
357
outer_tree = self.make_branch_and_tree('.')
357
358
inner_tree = self.make_branch_and_tree('branch')
358
359
self.build_tree_contents([
359
('branch/foo.c', b'int main() {}'),
360
('branch/bar.c', b'int main() {}')])
360
('branch/foo.c', 'int main() {}'),
361
('branch/bar.c', 'int main() {}')])
361
362
inner_tree.add(['foo.c', 'bar.c'])
362
363
# can't commit files in different trees; sane error
363
364
self.run_bzr('commit -m newstuff branch/foo.c .', retcode=3)
378
378
# commit to the original branch to make the checkout out of date
379
379
tree.commit('message branch', allow_pointless=True)
380
380
# now commit to the checkout should emit
381
# ERROR: Out of date with the branch, 'brz update' is suggested
381
# ERROR: Out of date with the branch, 'bzr update' is suggested
382
382
output = self.run_bzr('commit --unchanged -m checkout_message '
383
'checkout', retcode=3)
383
'checkout', retcode=3)
384
384
self.assertEqual(output,
386
"brz: ERROR: Working tree is out of date, please "
387
"run 'brz update'.\n"))
386
"bzr: ERROR: Working tree is out of date, please "
387
"run 'bzr update'.\n"))
389
389
def test_local_commit_unbound(self):
390
390
# a --local commit on an unbound branch is an error
391
391
self.make_branch_and_tree('.')
392
392
out, err = self.run_bzr('commit --local', retcode=3)
393
393
self.assertEqualDiff('', out)
394
self.assertEqualDiff('brz: ERROR: Cannot perform local-only commits '
394
self.assertEqualDiff('bzr: ERROR: Cannot perform local-only commits '
395
395
'on unbound branches.\n', err)
397
397
def test_commit_a_text_merge_in_a_checkout(self):
403
403
trunk = self.make_branch_and_tree('trunk')
405
405
u1 = trunk.branch.create_checkout('u1')
406
self.build_tree_contents([('u1/hosts', b'initial contents\n')])
406
self.build_tree_contents([('u1/hosts', 'initial contents\n')])
408
408
self.run_bzr('commit -m add-hosts u1')
410
410
u2 = trunk.branch.create_checkout('u2')
411
self.build_tree_contents([('u2/hosts', b'altered in u2\n')])
411
self.build_tree_contents([('u2/hosts', 'altered in u2\n')])
412
412
self.run_bzr('commit -m checkin-from-u2 u2')
414
414
# make an offline commits
415
self.build_tree_contents(
416
[('u1/hosts', b'first offline change in u1\n')])
415
self.build_tree_contents([('u1/hosts', 'first offline change in u1\n')])
417
416
self.run_bzr('commit -m checkin-offline --local u1')
419
418
# now try to pull in online work from u2, and then commit our offline
420
419
# work as a merge
421
420
# retcode 1 as we expect a text conflict
422
421
self.run_bzr('update u1', retcode=1)
423
self.assertFileEqual(b'''\
422
self.assertFileEqual('''\
425
424
first offline change in u1
531
530
'commit -m hello --fixes=lp:23452 tree/hello.txt')
532
531
self.assertEqual('', output)
533
532
self.assertContainsRe(err, 'Committing to: .*\n'
534
'added hello\\.txt\n'
535
'Committed revision 1\\.\n')
537
def test_fixes_bug_unicode(self):
538
"""commit --fixes=lp:unicode succeeds without output."""
539
tree = self.make_branch_and_tree('tree')
540
self.build_tree(['tree/hello.txt'])
541
tree.add('hello.txt')
542
output, err = self.run_bzr_raw(
543
['commit', '-m', 'hello',
544
u'--fixes=generic:\u20ac', 'tree/hello.txt'],
545
encoding='utf-8', retcode=3)
546
self.assertEqual(b'', output)
547
self.assertContainsRe(err,
548
b'brz: ERROR: Unrecognized bug generic:\xe2\x82\xac\\. Commit refused.\n')
534
'Committed revision 1\.\n')
550
536
def test_no_bugs_no_properties(self):
551
537
"""If no bugs are fixed, the bugs property is not set.
563
549
del properties['branch-nick']
564
550
self.assertFalse('bugs' in properties)
566
def test_bugs_sets_property(self):
567
"""commit --bugs=lp:234 sets the lp:234 revprop to 'related'."""
568
tree = self.make_branch_and_tree('tree')
569
self.build_tree(['tree/hello.txt'])
570
tree.add('hello.txt')
571
self.run_bzr('commit -m hello --bugs=lp:234 tree/hello.txt')
573
# Get the revision properties, ignoring the branch-nick property, which
574
# we don't care about for this test.
575
last_rev = tree.branch.repository.get_revision(tree.last_revision())
576
properties = dict(last_rev.properties)
577
del properties[u'branch-nick']
579
self.assertEqual({u'bugs': 'https://launchpad.net/bugs/234 related'},
582
552
def test_fixes_bug_sets_property(self):
583
553
"""commit --fixes=lp:234 sets the lp:234 revprop to 'fixed'."""
584
554
tree = self.make_branch_and_tree('tree')
590
560
# we don't care about for this test.
591
561
last_rev = tree.branch.repository.get_revision(tree.last_revision())
592
562
properties = dict(last_rev.properties)
593
del properties[u'branch-nick']
563
del properties['branch-nick']
595
self.assertEqual({u'bugs': 'https://launchpad.net/bugs/234 fixed'},
565
self.assertEqual({'bugs': 'https://launchpad.net/bugs/234 fixed'},
598
568
def test_fixes_multiple_bugs_sets_properties(self):
652
621
self.build_tree(['tree/hello.txt'])
653
622
tree.add('hello.txt')
654
623
self.run_bzr_error(
655
["brz: ERROR: No tracker specified for bug 123. Use the form "
656
"'tracker:id' or specify a default bug tracker using the "
657
"`bugtracker` option.\n"
658
"See \"brz help bugs\" for more information on this feature. "
624
["bzr: ERROR: No tracker specified for bug 123. Use the form "
625
"'tracker:id' or specify a default bug tracker using the "
626
"`bugtracker` option.\n"
627
"See \"bzr help bugs\" for more information on this feature. "
660
629
'commit -m add-b --fixes=123',
661
630
working_dir='tree')
662
631
tree.branch.get_config_stack().set("bugtracker", "lp")
707
676
tree.add('hello.txt')
708
677
self.run_bzr(["commit", '-m', 'hello',
709
678
'--author', u'John D\xf6 <jdoe@example.com>',
711
680
last_rev = tree.branch.repository.get_revision(tree.last_revision())
712
681
properties = last_rev.properties
713
self.assertEqual(u'John D\xf6 <jdoe@example.com>',
714
properties['authors'])
682
self.assertEqual(u'John D\xf6 <jdoe@example.com>', properties['authors'])
716
684
def test_author_no_email(self):
717
685
"""Author's name without an email address is allowed, too."""
740
708
self.build_tree(['tree/hello.txt'])
741
709
tree.add('hello.txt')
742
710
out, err = self.run_bzr("commit -m hello "
743
"--commit-time='2009-10-10 08:00:00 +0100' tree/hello.txt")
711
"--commit-time='2009-10-10 08:00:00 +0100' tree/hello.txt")
744
712
last_rev = tree.branch.repository.get_revision(tree.last_revision())
745
713
self.assertEqual(
746
714
'Sat 2009-10-10 08:00:00 +0100',
747
715
osutils.format_date(last_rev.timestamp, last_rev.timezone))
717
def test_commit_time_negative_windows(self):
718
tree = self.make_branch_and_tree('tree')
719
self.build_tree(['tree/hello.txt'])
720
tree.add('hello.txt')
721
out, err = self.run_bzr("commit -m hello "
722
"--commit-time='1969-10-10 00:00:00 +0000' tree/hello.txt")
723
last_rev = tree.branch.repository.get_revision(tree.last_revision())
725
'Fri 1969-10-10 00:00:00 +0000',
726
osutils.format_date(last_rev.timestamp, last_rev.timezone))
728
def test_commit_time_negative_32bit(self):
729
tree = self.make_branch_and_tree('tree')
730
self.build_tree(['tree/hello.txt'])
731
tree.add('hello.txt')
732
out, err = self.run_bzr("commit -m hello "
733
"--commit-time='1900-01-01 00:00:00 +0000' tree/hello.txt")
734
last_rev = tree.branch.repository.get_revision(tree.last_revision())
736
'Mon 1900-01-01 00:00:00 +0000',
737
osutils.format_date(last_rev.timestamp, last_rev.timezone))
739
def test_commit_time_positive_32bit(self):
740
tree = self.make_branch_and_tree('tree')
741
self.build_tree(['tree/hello.txt'])
742
tree.add('hello.txt')
743
out, err = self.run_bzr("commit -m hello "
744
"--commit-time='2039-01-01 00:00:00 +0000' tree/hello.txt")
745
last_rev = tree.branch.repository.get_revision(tree.last_revision())
747
'Sat 2039-01-01 00:00:00 +0000',
748
osutils.format_date(last_rev.timestamp, last_rev.timezone))
749
750
def test_commit_time_bad_time(self):
750
751
tree = self.make_branch_and_tree('tree')
751
752
self.build_tree(['tree/hello.txt'])
752
753
tree.add('hello.txt')
753
754
out, err = self.run_bzr("commit -m hello "
754
"--commit-time='NOT A TIME' tree/hello.txt", retcode=3)
755
"--commit-time='NOT A TIME' tree/hello.txt", retcode=3)
755
756
self.assertStartsWith(
756
err, "brz: ERROR: Could not parse --commit-time:")
757
err, "bzr: ERROR: Could not parse --commit-time:")
758
759
def test_commit_time_missing_tz(self):
759
760
tree = self.make_branch_and_tree('tree')
760
761
self.build_tree(['tree/hello.txt'])
761
762
tree.add('hello.txt')
762
763
out, err = self.run_bzr("commit -m hello "
763
"--commit-time='2009-10-10 08:00:00' tree/hello.txt", retcode=3)
764
"--commit-time='2009-10-10 08:00:00' tree/hello.txt", retcode=3)
764
765
self.assertStartsWith(
765
err, "brz: ERROR: Could not parse --commit-time:")
766
err, "bzr: ERROR: Could not parse --commit-time:")
766
767
# Test that it is actually checking and does not simply crash with
767
768
# some other exception
768
769
self.assertContainsString(err, "missing a timezone offset")
778
779
# then during partial commit we have error
779
780
# parent_id {dir-XXX} not in inventory
780
781
t.rename_one('dir/a', 'a')
781
self.build_tree_contents([('test', b'changes in test')])
782
self.build_tree_contents([('test', 'changes in test')])
783
784
out, err = self.run_bzr('commit test -m "partial commit"')
784
785
self.assertEqual('', out)
793
794
self.get_readonly_transport('master')).open_branch()
794
795
master.create_checkout('checkout')
795
796
out, err = self.run_bzr(['commit', '--unchanged', '-mfoo', 'checkout'],
797
798
self.assertContainsRe(err,
798
r'^brz: ERROR: Cannot lock.*readonly transport')
799
r'^bzr: ERROR: Cannot lock.*readonly transport')
800
801
def setup_editor(self):
801
802
# Test that commit template hooks work
802
803
if sys.platform == "win32":
803
with open('fed.bat', 'w') as f:
804
f.write('@rem dummy fed')
805
self.overrideEnv('BRZ_EDITOR', "fed.bat")
804
f = file('fed.bat', 'w')
805
f.write('@rem dummy fed')
807
self.overrideEnv('BZR_EDITOR', "fed.bat")
807
with open('fed.sh', 'wb') as f:
808
f.write(b'#!/bin/sh\n')
809
os.chmod('fed.sh', 0o755)
810
self.overrideEnv('BRZ_EDITOR', "./fed.sh")
809
f = file('fed.sh', 'wb')
810
f.write('#!/bin/sh\n')
812
os.chmod('fed.sh', 0755)
813
self.overrideEnv('BZR_EDITOR', "./fed.sh")
812
815
def setup_commit_with_template(self):
813
816
self.setup_editor()
814
817
msgeditor.hooks.install_named_hook("commit_message_template",
815
lambda commit_obj, msg: "save me some typing\n", None)
818
lambda commit_obj, msg: "save me some typing\n", None)
816
819
tree = self.make_branch_and_tree('tree')
817
820
self.build_tree(['tree/hello.txt'])
818
821
tree.add('hello.txt')
824
827
self.build_tree(['tree/hello.txt'])
825
828
tree.add('hello.txt')
826
829
out, err = self.run_bzr("commit tree/hello.txt", retcode=3,
828
831
self.assertContainsRe(err,
829
"brz: ERROR: Empty commit message specified")
832
"bzr: ERROR: Empty commit message specified")
831
834
def test_commit_hook_template_accepted(self):
832
835
tree = self.setup_commit_with_template()
838
841
tree = self.setup_commit_with_template()
839
842
expected = tree.last_revision()
840
843
out, err = self.run_bzr_error(["Empty commit message specified."
841
" Please specify a commit message with either"
842
" --message or --file or leave a blank message"
843
" with --message \"\"."],
844
"commit tree/hello.txt", stdin="n\n")
844
" Please specify a commit message with either"
845
" --message or --file or leave a blank message"
846
" with --message \"\"."],
847
"commit tree/hello.txt", stdin="n\n")
845
848
self.assertEqual(expected, tree.last_revision())
847
850
def test_set_commit_message(self):
848
851
msgeditor.hooks.install_named_hook("set_commit_message",
849
lambda commit_obj, msg: "save me some typing\n", None)
852
lambda commit_obj, msg: "save me some typing\n", None)
850
853
tree = self.make_branch_and_tree('tree')
851
854
self.build_tree(['tree/hello.txt'])
852
855
tree.add('hello.txt')
861
864
with open('foo/foo.txt', 'w') as f:
863
866
self.run_bzr(['add'], working_dir='foo')
864
override_whoami(self)
867
self.overrideEnv('EMAIL', None)
868
self.overrideEnv('BZR_EMAIL', None)
869
# Also, make sure that it's not inferred from mailname.
870
self.overrideAttr(config, '_auto_user_id',
871
lambda: (None, None))
865
872
self.run_bzr_error(
866
873
['Unable to determine your name'],
867
874
['commit', '-m', 'initial'], working_dir='foo')
872
879
self.run_bzr(['init', 'test_branch'])
873
880
self.run_bzr(['checkout', 'test_branch', 'test_checkout'])
875
self.run_bzr(['bind', '.'], working_dir='test_checkout')
881
self.run_bzr(['bind', '.'], working_dir='test_checkout') # bind to self
876
882
with open('test_checkout/foo.txt', 'w') as f:
878
884
self.run_bzr(['add'], working_dir='test_checkout')