~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Martin Pool
  • Date: 2008-10-20 23:58:12 UTC
  • mto: This revision was merged to the branch mainline in revision 3787.
  • Revision ID: mbp@sourcefrog.net-20081020235812-itg90mk0u4dez92z
lp-upload-release now handles names like bzr-1.8.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Helper functions for adding files to working trees."""
18
18
 
 
19
import errno
 
20
import os
19
21
import sys
20
22
 
21
23
import bzrlib.bzrdir
 
24
import bzrlib.errors as errors
22
25
import bzrlib.osutils
23
26
from bzrlib.symbol_versioning import *
 
27
from bzrlib.workingtree import WorkingTree
24
28
 
25
29
 
26
30
class AddAction(object):
31
35
 
32
36
        :param to_file: The stream to write into. This is expected to take
33
37
            Unicode paths. If not supplied, it will default to ``sys.stdout``.
34
 
        :param should_print: If False, printing will be suppressed.
 
38
        :param should_print: If False, printing will be supressed.
35
39
        """
36
40
        self._to_file = to_file
37
41
        if to_file is None:
50
54
        :param kind: The kind of the object being added.
51
55
        """
52
56
        if self.should_print:
53
 
            self._to_file.write('adding %s\n' % _quote(path.raw_path))
 
57
            self._to_file.write('added %s\n' % _quote(path.raw_path))
54
58
        return None
55
59
 
56
60
 
69
73
        file_id, base_path = self._get_base_file_id(path, parent_ie)
70
74
        if file_id is not None:
71
75
            if self.should_print:
72
 
                self._to_file.write('adding %s w/ file id from %s\n'
 
76
                self._to_file.write('added %s w/ file id from %s\n'
73
77
                                    % (path.raw_path, base_path))
74
78
        else:
75
79
            # we aren't doing anything special, so let the default