~lifeless/bzrtools/trunk

« back to all changes in this revision

Viewing changes to hunk_selector.py

  • Committer: Robert Collins
  • Date: 2008-07-08 04:10:56 UTC
  • Revision ID: robertc@robertcollins.net-20080708041056-f4c2a420k479zmxh
Teach shelve to create a merge --interactive.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
class HunkSelector:
8
8
    strings = {}
9
9
 
10
 
    def __init__(self, patches, color=None):
 
10
    def __init__(self, patches, color=None, merge_mode=False):
11
11
        if color is True or color is None:
12
12
            try:
13
13
                from colordiff import DiffWriter
172
172
 
173
173
        return (selected_patches, unselected_patches)
174
174
 
 
175
 
 
176
class MergeHunkSelector(HunkSelector):
 
177
    def __init__(self, patches, color=None):
 
178
        self.strings = {}
 
179
        self.strings['status_selected'] = '%d hunks to be merged'
 
180
        self.strings['status_unselected'] = '%d hunks to be discarded'
 
181
        self.strings['select_desc'] = 'merge this change.'
 
182
        self.strings['unselect_desc'] = 'discard this change.'
 
183
        self.strings['finish_desc'] = 'merge selected changes.'
 
184
        self.strings['prompt'] = 'Merge this change? (%(count)d of %(total)d)'
 
185
        self.strings['end_prompt'] = 'Merge these changes?'
 
186
        HunkSelector.__init__(self, patches, color)
 
187
 
 
188
 
175
189
class ShelveHunkSelector(HunkSelector):
176
190
    def __init__(self, patches, color=None):
177
191
        self.strings = {}