~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/ui.txt

Merge bzr.dev to resolve news conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
==========================================
2
 
Bazaar Developer Guide to User Interaction
3
 
==========================================
 
1
=========================
 
2
Interacting with the user
 
3
=========================
4
4
 
5
5
Getting Input
6
6
=============
24
24
used for programmer convenience, but not performing unpredictably in the
25
25
presence of different locales.
26
26
 
 
27
Confirmation
 
28
============
 
29
 
 
30
There are some operations, such as uncommitting, or breaking a lock, where
 
31
bzr may want to get confirmation from the user before proceeding.
 
32
However in some circumstances bzr should just go ahead without asking: if
 
33
it's being used from a noninteractive program, or if the user's asked to
 
34
never be asked for this particular confirmation or for any confirmations
 
35
at all.
 
36
 
 
37
We provide a special UIFactory method `confirm_action` to do this.  It
 
38
takes a `confirmation_id` parameter that acts as a symbolic name for the
 
39
type of confirmation, so the user can configure them off.  (This is not
 
40
implemented at present.)  GUIs can have a "don't ask me again" option
 
41
keyed by the confirmation id.
 
42
 
 
43
Confirmation ids look like Python paths to the logical code that should
 
44
use them.  (Because code may move or the check may for implementation
 
45
reasons be done elsewhere, they need not perfectly correspond to the place
 
46
they're used, and they should stay stable even when the code moves.)
 
47
 
 
48
``bzrlib.builtins.uncommit``
 
49
    Before the ``uncommit`` command actually changes the branch.
 
50
 
 
51
``bzrlib.lockdir.break``
 
52
    Before breaking a lock.
 
53
 
 
54
``bzrlib.msgeditor.unchanged``
 
55
    Proceed even though the user made no changes to the template message.
 
56
 
 
57
Interactive confirmations can be overridden by using a
 
58
`ConfirmationUserInterfacePolicy` decorator as the default
 
59
ui_factory.
 
60
 
27
61
 
28
62
Writing Output
29
63
==============