241
241
self.runbzr('revert')
244
def test_status(self):
246
self.build_tree(['hello.txt'])
247
result = self.runbzr("status")
248
self.assert_("unknown:\n hello.txt\n" in result, result)
249
self.runbzr("add hello.txt")
250
result = self.runbzr("status")
251
self.assert_("added:\n hello.txt\n" in result, result)
252
self.runbzr("commit -m added")
253
result = self.runbzr("status -r 0..1")
254
self.assert_("added:\n hello.txt\n" in result, result)
255
self.build_tree(['world.txt'])
256
result = self.runbzr("status -r 0")
257
self.assert_("added:\n hello.txt\n" \
258
"unknown:\n world.txt\n" in result, result)
260
244
def test_mv_modes(self):
261
245
"""Test two modes of operation for mv"""
262
246
self.runbzr('init')
830
814
self.runbzr('commit -m conflicts')
831
815
self.assertEquals(result, "")
833
def test_resign(self):
834
"""Test re signing of data."""
836
oldstrategy = bzrlib.gpg.GPGStrategy
837
wt = WorkingTree.create_standalone('.')
839
wt.commit("base", allow_pointless=True, rev_id='A')
841
# monkey patch gpg signing mechanism
842
from bzrlib.testament import Testament
843
bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
844
self.runbzr('re-sign -r revid:A')
845
self.assertEqual(Testament.from_revision(branch.repository,
846
'A').as_short_text(),
847
branch.repository.revision_store.get('A',
850
bzrlib.gpg.GPGStrategy = oldstrategy
852
def test_resign_range(self):
854
oldstrategy = bzrlib.gpg.GPGStrategy
855
wt = WorkingTree.create_standalone('.')
857
wt.commit("base", allow_pointless=True, rev_id='A')
858
wt.commit("base", allow_pointless=True, rev_id='B')
859
wt.commit("base", allow_pointless=True, rev_id='C')
861
# monkey patch gpg signing mechanism
862
from bzrlib.testament import Testament
863
bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
864
self.runbzr('re-sign -r 1..')
866
Testament.from_revision(branch.repository,'A').as_short_text(),
867
branch.repository.revision_store.get('A', 'sig').read())
869
Testament.from_revision(branch.repository,'B').as_short_text(),
870
branch.repository.revision_store.get('B', 'sig').read())
871
self.assertEqual(Testament.from_revision(branch.repository,
872
'C').as_short_text(),
873
branch.repository.revision_store.get('C',
876
bzrlib.gpg.GPGStrategy = oldstrategy
878
817
def test_push(self):
879
818
# create a source branch
880
819
os.mkdir('my-branch')