~bialix/bzr-commit-selector/trunk

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Alexander Belchenko
  • Date: 2007-05-22 07:53:49 UTC
  • Revision ID: bialix@ukr.net-20070522075349-oixzl16exbeghkiu
Don't show pending merges and unversioned files when launching select

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
from bzrlib.option import Option
15
15
 
16
16
 
17
 
VERSION = "0.16.1"
 
17
VERSION = "0.16.2"
18
18
USAGE = u"""# Select files to commit.
19
19
# Root of your tree: %s
20
20
#
21
21
# Leave line with file name unchanged to select file for committing.
22
22
# Delete line with file name or comment it with '#' sign to unselect.
23
23
 
 
24
%s
24
25
"""
25
26
 
26
27
 
35
36
        if select:
36
37
            import codecs
37
38
            import os
 
39
            from StringIO import StringIO
38
40
            import tempfile
39
41
            from bzrlib import msgeditor
 
42
            from bzrlib.status import show_tree_status
40
43
 
41
44
            tree, selected_list = builtins.tree_files(selected_list)
42
45
 
43
 
            template = msgeditor.make_commit_message_template(tree, selected_list)
 
46
            sio = StringIO()
 
47
            show_tree_status(tree,
 
48
                             specific_files=selected_list,
 
49
                             to_file=sio,
 
50
                             show_pending=False,
 
51
                             versioned=True,
 
52
                             )
 
53
            template = sio.getvalue()
 
54
 
44
55
            root = tree.basedir
45
 
            msg = USAGE % root + template
 
56
            msg = USAGE % (root, template)
46
57
 
47
58
            try:
48
59
                tmp_fileno, msgfilename = tempfile.mkstemp(prefix='bzr_commit.',