/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/init.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-07-21 18:18:20 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-20060721181820-450b5e29bb2614d9
2006-07-21  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/olive.glade: some UI refreshment (push, remove and commit dialog)
    * olive/frontend/gtk/push.py: implemented 'push' functionality
    * olive/frontend/gtk/commit.py: implemented 'commit' functionality
    * olive/frontend/gtk/remove.py: implemented 'remove' functionality
    * olive/frontend/gtk/add.py: implemented 'add' functionality
    * olive/frontend/gtk/handler.py: implemented 'init' functionality
    * olive/backend/fileops.py: added recursive mode to add(), added
      NotBranchError exception to add() and remove()

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
                    NonExistingParent, NonExistingRevision,
30
30
                    NonExistingSource, NotBranchError, TargetAlreadyExists)
31
31
 
32
 
def init(location):
33
 
    """ Initialize a directory.
34
 
    
35
 
    :param location: full path to the directory you want to be versioned
36
 
    """
37
 
    from bzrlib.builtins import get_format_type
38
 
 
39
 
    format = get_format_type('default')
40
 
 
41
 
    if not os.path.exists(location):
42
 
        os.mkdir(location)
43
 
 
44
 
    try:
45
 
        existing_bzrdir = bzrdir.BzrDir.open(location)
46
 
    except errors.NotBranchError:
47
 
        bzrdir.BzrDir.create_branch_convenience(location, format=format)
48
 
    else:
49
 
        if existing_bzrdir.has_branch():
50
 
            if existing_bzrdir.has_workingtree():
51
 
                raise AlreadyBranchError(location)
52
 
            else:
53
 
                raise BranchExistsWithoutWorkingTree(location)
54
 
        else:
55
 
            existing_bzrdir.create_branch()
56
 
            existing_bzrdir.create_workingtree()
57
 
 
58
32
def branch(from_location, to_location, revision=None):
59
33
    """ Create a branch from a local/remote location.
60
34
    
175
149
        checkout.create_workingtree(revision_id)
176
150
    finally:
177
151
        bzrlib.bzrdir.BzrDirFormat.set_default_format(old_format)
 
152
 
 
153
def init(location):
 
154
    """ Initialize a directory.
 
155
    
 
156
    :param location: full path to the directory you want to be versioned
 
157
    """
 
158
    from bzrlib.builtins import get_format_type
 
159
 
 
160
    format = get_format_type('default')
 
161
 
 
162
    if not os.path.exists(location):
 
163
        os.mkdir(location)
 
164
 
 
165
    try:
 
166
        existing_bzrdir = bzrdir.BzrDir.open(location)
 
167
    except errors.NotBranchError:
 
168
        bzrdir.BzrDir.create_branch_convenience(location, format=format)
 
169
    else:
 
170
        if existing_bzrdir.has_branch():
 
171
            if existing_bzrdir.has_workingtree():
 
172
                raise AlreadyBranchError(location)
 
173
            else:
 
174
                raise BranchExistsWithoutWorkingTree(location)
 
175
        else:
 
176
            existing_bzrdir.create_branch()
 
177
            existing_bzrdir.create_workingtree()