~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shelf.py

  • Committer: Aaron Bentley
  • Date: 2005-09-29 16:21:15 UTC
  • mfrom: (205)
  • mto: (147.2.17)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: abentley@panoramicfeedback.com-20050929162115-9ee96ca755344dd7
Merged changes from mainline

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.