~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

[merge] win32

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
                            compact_date,
64
64
                            file_kind,
65
65
                            isdir,
 
66
                            getcwd,
 
67
                            pathjoin,
66
68
                            pumpfile,
67
69
                            splitpath,
68
70
                            rand_bytes,
 
71
                            abspath,
 
72
                            normpath,
69
73
                            realpath,
70
74
                            relpath,
71
75
                            rename)
 
76
from bzrlib.textui import show_status
72
77
import bzrlib.tree
73
78
from bzrlib.trace import mutter
74
79
import bzrlib.xml5
224
229
        If there is one, it is returned, along with the unused portion of path.
225
230
        """
226
231
        if path is None:
227
 
            path = os.getcwdu()
 
232
            path = getcwd()
228
233
        else:
229
234
            # sanity check.
230
235
            if path.find('://') != -1:
231
236
                raise NotBranchError(path=path)
232
 
        path = os.path.abspath(path)
 
237
        path = abspath(path)
233
238
        tail = u''
234
239
        while True:
235
240
            try:
237
242
            except NotBranchError:
238
243
                pass
239
244
            if tail:
240
 
                tail = os.path.join(os.path.basename(path), tail)
 
245
                tail = pathjoin(os.path.basename(path), tail)
241
246
            else:
242
247
                tail = os.path.basename(path)
 
248
            lastpath = path
243
249
            path = os.path.dirname(path)
244
 
            # FIXME: top in windows is indicated how ???
245
 
            if path == os.path.sep:
 
250
            if lastpath == path:
246
251
                # reached the root, whatever that may be
247
252
                raise NotBranchError(path=path)
248
253
 
262
267
                               getattr(self, 'basedir', None))
263
268
 
264
269
    def abspath(self, filename):
265
 
        return os.path.join(self.basedir, filename)
 
270
        return pathjoin(self.basedir, filename)
266
271
 
267
 
    def relpath(self, abspath):
 
272
    def relpath(self, abs):
268
273
        """Return the local path portion from a given absolute path."""
269
 
        return relpath(self.basedir, abspath)
 
274
        return relpath(self.basedir, abs)
270
275
 
271
276
    def has_filename(self, filename):
272
277
        return bzrlib.osutils.lexists(self.abspath(filename))
371
376
            if len(fp) == 0:
372
377
                raise BzrError("cannot add top-level %r" % f)
373
378
 
374
 
            fullpath = os.path.normpath(self.abspath(f))
 
379
            fullpath = normpath(self.abspath(f))
375
380
 
376
381
            try:
377
382
                kind = file_kind(fullpath)