~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shelf.py

  • Committer: Michael Ellerman
  • Date: 2005-11-29 01:41:15 UTC
  • mto: (0.3.1 shelf-dev) (325.1.2 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 334.
  • Revision ID: michael@ellerman.id.au-20051129014115-eff5eb80bc51e0f5
Make HunkSelector agnostic as to whether it's selecting for shelving or
unshelving. Create ShelveHunkSelector() and UnshelveHunkSelector() to
encapsulate this, a bit ugly, but reasonable.

Rename callbacks to be private, ie. beginning with _.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
from bzrlib.commands import Command
10
10
from bzrlib.branch import Branch
11
11
from bzrlib import DEFAULT_IGNORE
12
 
from hunk_selector import HunkSelector
 
12
from hunk_selector import ShelveHunkSelector, UnshelveHunkSelector
13
13
from diffstat import DiffStat
14
14
 
15
15
DEFAULT_IGNORE.append('./.bzr-shelf*')
65
65
        patches = parse_patches(open(shelf, 'r').readlines())
66
66
        if pick_hunks:
67
67
            try:
68
 
                patches = HunkSelector(patches).select()
 
68
                patches = UnshelveHunkSelector(patches).select()
69
69
            except QuitException:
70
70
                return False
71
71
 
108
108
 
109
109
        if pick_hunks:
110
110
            try:
111
 
                patches = HunkSelector(patches).select()
 
111
                patches = ShelveHunkSelector(patches).select()
112
112
            except QuitException:
113
113
                return False
114
114