~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shelf.py

  • Committer: Aaron Bentley
  • Date: 2005-09-29 16:19:07 UTC
  • Revision ID: abentley@panoramicfeedback.com-20050929161907-960957f0bbfbd3f0
Fixed -r parameter to shelve

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
import tty, termios
8
8
import glob
9
9
from bzrlib.commands import Command
 
10
from bzrlib.branch import Branch
10
11
 
11
12
def main(args):
12
13
    name = os.path.basename(args.pop(0))
165
166
    takes_args = ['file*']
166
167
    takes_options = ['message', 'revision']
167
168
    def run(self, file_list=None, message=None, revision=None):
168
 
        return shelve(message=message, file_list=file_list, revision=revision)
 
169
        revision_list = None
 
170
        if revision is not None and revision:
 
171
            if file_list is not None and len(file_list) > 0:
 
172
                branchdir = file_list[0]
 
173
            else:
 
174
                branchdir = '.'
 
175
            b = Branch.open_containing(branchdir)
 
176
            revision_list = ["revid:" + revision[0].in_history(b).rev_id]
 
177
 
 
178
        return shelve(message=message, file_list=file_list, 
 
179
                      revision=revision_list)
169
180
 
170
181
class cmd_unshelve(Command):
171
182
    """Restore previously-shelved changes to the current tree.