~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

Added unit tests for find_unmerged

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