~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shelf.py

  • Committer: Michael Ellerman
  • Date: 2005-10-19 12:29:16 UTC
  • mto: (0.3.1 shelf-dev) (325.1.2 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 246.
  • Revision ID: michael@ellerman.id.au-20051019122916-5e6715d4b981080a
Implement "bzr shelve --all".

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
 
97
97
        return True
98
98
 
99
 
    def shelve(self, message=None, revision=None, file_list=None):
 
99
    def shelve(self, all_hunks=False, message=None, revision=None,
 
100
             file_list=None):
100
101
        cmd = ['diff']
101
102
        if revision is not None:
102
103
            cmd.extend(['--revision', str(revision[0])])
103
104
        if file_list is not None:
104
105
            cmd.extend(file_list)
105
106
        patches = parse_patches(run_bzr(cmd))
106
 
        try:
107
 
            patches = HunkSelector(patches).select()
108
 
        except QuitException:
109
 
            return False
 
107
        if not all_hunks:
 
108
            try:
 
109
                patches = HunkSelector(patches).select()
 
110
            except QuitException:
 
111
                return False
110
112
 
111
113
        if len(patches) == 0:
112
114
            print >>sys.stderr, 'Nothing to shelve'