/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/backend/info.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-08-01 16:16:31 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060801161631-ca1ac79e3726e307
Visual feedback when Olive is busy; follow bzr API changes; commit dialog update

2006-08-01  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/frontend/gtk/push.py: now the number of pushed revisions gets
      displayed (Fixed: #54698)
    * olive/backend/info.py: added is_checkout()
    * olive/frontend/gtk/commit.py: local commit checkbox shows up only if the
      current directory is a checkout
    * olive/backend/fileops.py: upgraded to new API (compare_trees deprecated)
    * many files: the cursor changes to a watch when performing time consuming
      operations (Fixed: #54015)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import bzrlib.errors as errors
21
21
 
22
22
from bzrlib.branch import Branch
 
23
from bzrlib.workingtree import WorkingTree
23
24
 
24
25
from errors import (DifferentBranchesError, NotBranchError, PrefixFormatError,
25
26
                    RevisionValueError)
222
223
    except errors.NoRepositoryPresent:
223
224
        pass
224
225
 
 
226
def is_checkout(location):
 
227
    """ Check if the location is a checkout.
 
228
    
 
229
    :param location: the location you want to check
 
230
    
 
231
    :return: True or False respectively
 
232
    """
 
233
    try:
 
234
        branch = Branch.open_containing(location)[0]
 
235
    except errors.NotBranchError:
 
236
        raise NotBranchError
 
237
    
 
238
    try:
 
239
        working = WorkingTree.open_containing(location)[0]
 
240
    except:
 
241
        raise
 
242
    
 
243
    working_path = working.bzrdir.root_transport.base
 
244
    branch_path = branch.bzrdir.root_transport.base
 
245
    
 
246
    if working_path != branch_path:
 
247
        # lightweight checkout
 
248
        return True
 
249
    elif branch.get_bound_location():
 
250
        # checkout
 
251
        return True
 
252
    else:
 
253
        return False
 
254
 
 
255
 
225
256
def log(location, timezone='original', verbose=False, show_ids=False,
226
257
        forward=False, revision=None, log_format=None, message=None,
227
258
        long=False, short=False, line=False):