814
814
self.runbzr('commit -m conflicts')
815
815
self.assertEquals(result, "")
817
def test_resign(self):
818
"""Test re signing of data."""
820
oldstrategy = bzrlib.gpg.GPGStrategy
821
wt = WorkingTree.create_standalone('.')
823
wt.commit("base", allow_pointless=True, rev_id='A')
825
# monkey patch gpg signing mechanism
826
from bzrlib.testament import Testament
827
bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
828
self.runbzr('re-sign -r revid:A')
829
self.assertEqual(Testament.from_revision(branch.repository,
830
'A').as_short_text(),
831
branch.repository.revision_store.get('A',
834
bzrlib.gpg.GPGStrategy = oldstrategy
836
def test_resign_range(self):
838
oldstrategy = bzrlib.gpg.GPGStrategy
839
wt = WorkingTree.create_standalone('.')
841
wt.commit("base", allow_pointless=True, rev_id='A')
842
wt.commit("base", allow_pointless=True, rev_id='B')
843
wt.commit("base", allow_pointless=True, rev_id='C')
845
# monkey patch gpg signing mechanism
846
from bzrlib.testament import Testament
847
bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
848
self.runbzr('re-sign -r 1..')
850
Testament.from_revision(branch.repository,'A').as_short_text(),
851
branch.repository.revision_store.get('A', 'sig').read())
853
Testament.from_revision(branch.repository,'B').as_short_text(),
854
branch.repository.revision_store.get('B', 'sig').read())
855
self.assertEqual(Testament.from_revision(branch.repository,
856
'C').as_short_text(),
857
branch.repository.revision_store.get('C',
860
bzrlib.gpg.GPGStrategy = oldstrategy
862
817
def test_push(self):
863
818
# create a source branch
864
819
os.mkdir('my-branch')