~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Robert Collins
  • Date: 2010-06-28 02:41:22 UTC
  • mto: This revision was merged to the branch mainline in revision 5324.
  • Revision ID: robertc@robertcollins.net-20100628024122-g951fzp74f3u6wst
Sanity check that new_trace_file in pop_log_file is valid, and also fix a test that monkey patched get_terminal_encoding.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Helper functions for adding files to working trees."""
18
18
 
19
 
import errno
20
 
import os
21
19
import sys
22
20
 
23
 
import bzrlib.bzrdir
24
 
import bzrlib.errors as errors
25
21
import bzrlib.osutils
26
 
from bzrlib.symbol_versioning import *
27
 
from bzrlib.workingtree import WorkingTree
28
22
 
29
23
 
30
24
class AddAction(object):
35
29
 
36
30
        :param to_file: The stream to write into. This is expected to take
37
31
            Unicode paths. If not supplied, it will default to ``sys.stdout``.
38
 
        :param should_print: If False, printing will be supressed.
 
32
        :param should_print: If False, printing will be suppressed.
39
33
        """
40
34
        self._to_file = to_file
41
35
        if to_file is None:
99
93
        full_base_path = bzrlib.osutils.pathjoin(self.base_path, path.raw_path)
100
94
        # This may return None, but it is our last attempt
101
95
        return self.base_tree.path2id(full_base_path), full_base_path
102
 
 
103
 
 
104
 
# TODO: jam 20050105 These could be used for compatibility
105
 
#       however, they bind against the current stdout, not the
106
 
#       one which exists at the time they are called, so they
107
 
#       don't work for the test suite.
108
 
# deprecated
109
 
add_action_add = AddAction()
110
 
add_action_null = add_action_add
111
 
add_action_add_and_print = AddAction(should_print=True)
112
 
add_action_print = add_action_add_and_print