/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/fileops.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:
22
22
 
23
23
from errors import (DirectoryAlreadyExists, MissingArgumentError,
24
24
                    MultipleMoveError, NoFilesSpecified, NoMatchingFiles,
25
 
                    NonExistingSource, NotVersionedError)
 
25
                    NonExistingSource, NotBranchError, NotVersionedError)
26
26
 
27
 
def add(file_list):
 
27
def add(file_list, recursive=False):
28
28
    """ Add listed files to the branch. 
29
29
    
30
30
    :param file_list - list of files to be added (using full paths)
31
31
    
 
32
    :param recursive - if True, all unknown files will be added
 
33
    
32
34
    :return: count of ignored files
33
35
    """
34
36
    import bzrlib.add
35
37
    
36
 
    added, ignored = bzrlib.add.smart_add(file_list)
 
38
    try:
 
39
        added, ignored = bzrlib.add.smart_add(file_list, recursive)
 
40
    except errors.NotBranchError:
 
41
        raise NotBranchError
 
42
    except:
 
43
        raise
37
44
    
38
45
    match_len = 0
39
46
    for glob, paths in ignored.items():
86
93
    """
87
94
    from bzrlib.builtins import tree_files
88
95
    
89
 
    tree, file_list = tree_files(file_list)
 
96
    try:
 
97
        tree, file_list = tree_files(file_list)
 
98
    except errors.NotBranchError:
 
99
        raise NotBranchError
 
100
    except:
 
101
        raise
90
102
    
91
103
    if new is False:
92
104
        if file_list is None:
136
148
    
137
149
    # find the relative path to the given file (needed for proper delta)
138
150
    wtpath = tree1.basedir
 
151
    #print "DEBUG: wtpath =", wtpath
139
152
    fullpath = filename
 
153
    #print "DEBUG: fullpath =", fullpath
140
154
    i = 0
141
155
    wtsplit = wtpath.split('/')
142
156
    fpsplit = fullpath.split('/')
147
161
                del fpcopy[0]
148
162
            i = i + 1
149
163
    rel = '/'.join(fpcopy)
 
164
    #print "DEBUG: rel =", rel
150
165
    
151
166
    delta = compare_trees(old_tree=tree2,
152
167
                          new_tree=tree1,
159
174
        print path
160
175
    print
161
176
    print "DEBUG: delta.added:"
162
 
    for path, id, kind, text_modified, meta_modified in delta.added:
 
177
    for path, id, kind in delta.added:
163
178
        print path
164
179
    print
165
180
    print "DEBUG: delta.removed:"