~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: John Arbash Meinel
  • Date: 2006-02-14 17:01:48 UTC
  • mto: (1185.79.1 bzr-jam-pending)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: john@arbash-meinel.com-20060214170148-2765fe23e7309b93
Updating bzr re-sign to allow multiple arguments, and updating tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1955
1955
    # TODO be able to replace existing ones.
1956
1956
 
1957
1957
    hidden = True # is this right ?
1958
 
    takes_args = ['revision_id?']
 
1958
    takes_args = ['revision_id*']
1959
1959
    takes_options = ['revision']
1960
1960
    
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)