1955
1955
# TODO be able to replace existing ones.
1957
1957
hidden = True # is this right ?
1958
takes_args = ['revision_id?']
1958
takes_args = ['revision_id*']
1959
1959
takes_options = ['revision']
1961
def run(self, revision_id=None, revision=None):
1961
def run(self, revision_id_list=None, revision=None):
1962
1962
import bzrlib.config as config
1963
1963
import bzrlib.gpg as gpg
1964
if revision_id is not None and revision is not None:
1964
if revision_id_list is not None and revision is not None:
1965
1965
raise BzrCommandError('You can only supply one of revision_id or --revision')
1966
if revision_id is None and revision is None:
1966
if revision_id_list is None and revision is None:
1967
1967
raise BzrCommandError('You must supply either --revision or a revision_id')
1968
1968
b = WorkingTree.open_containing(u'.')[0].branch
1969
1969
gpg_strategy = gpg.GPGStrategy(config.BranchConfig(b))
1970
if revision_id is not None:
1971
b.repository.sign_revision(revision_id, gpg_strategy)
1970
if revision_id_list is not None:
1971
for revision_id in revision_id_list:
1972
b.repository.sign_revision(revision_id, gpg_strategy)
1972
1973
elif revision is not None:
1973
1974
if len(revision) == 1:
1974
1975
revno, rev_id = revision[0].in_history(b)