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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-06-11 19:06:06 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-20060611190606-313cd4690a10cd78
* backend/commit.py: commit() implemented
* backend/fileops.py: remove() implemented
* backend/errors.py: more exceptions added
* more detailed comments for the different functions

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
                    RevisionValueError, TargetAlreadyExists)
27
27
 
28
28
def init(location):
 
29
    """ Initialize a directory.
 
30
    
 
31
    :param location: full path to the directory you want to be versioned
 
32
    """
29
33
    from bzrlib.builtins import get_format_type
30
34
    import bzrlib.bzrdir as bzrdir
31
35
 
49
53
            existing_bzrdir.create_workingtree()
50
54
 
51
55
def branch(from_location, to_location, revision=None):
 
56
    """ Create a branch from a local/remote location.
 
57
    
 
58
    :param from_location: The original location of the branch
 
59
    
 
60
    :param to_location: The directory where the branch should be created
 
61
    
 
62
    :param revision: if specified, the given revision will be branched
 
63
    
 
64
    :return: number of revisions branched
 
65
    """
52
66
    from bzrlib.branch import Branch
53
67
    from bzrlib.transport import get_transport
54
68
 
55
69
    if revision is None:
56
70
        revision = [None]
57
71
    elif len(revision) > 1:
58
 
        raise RevisionValueError('bzr branch --revision takes exactly 1 revision value')
 
72
        raise RevisionValueError
59
73
 
60
74
    try:
61
75
        br_from = Branch.open(from_location)