~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Martin Pool
  • Date: 2005-10-06 08:11:46 UTC
  • mto: (1185.13.3)
  • mto: This revision was merged to the branch mainline in revision 1418.
  • Revision ID: mbp@sourcefrog.net-20051006081146-6be9d0613fd0d24d
- fix join of weaves where parents occur at different offsets
- test for this

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
from bzrlib.inventory import InventoryEntry
17
18
from bzrlib.trace import mutter, note, warning
18
19
from bzrlib.errors import NotBranchError
19
20
from bzrlib.branch import Branch
22
23
 
23
24
def glob_expand_for_win32(file_list):
24
25
    import glob
25
 
    
26
26
    expanded_file_list = []
27
27
    for possible_glob in file_list:
28
28
        glob_files = glob.glob(possible_glob)
64
64
    Returns the number of files added.
65
65
    """
66
66
    file_list = _prepare_file_list(file_list)
67
 
    b = Branch(file_list[0], find_root=True)
 
67
    b = Branch.open_containing(file_list[0])
68
68
    return smart_add_branch(b, file_list, recurse, reporter)
69
69
 
70
70
        
96
96
 
97
97
        kind = bzrlib.osutils.file_kind(af)
98
98
 
99
 
        if kind != 'file' and kind != 'directory':
 
99
        if not InventoryEntry.versionable_kind(kind):
100
100
            if f in user_list:
101
101
                raise BadFileKindError("cannot add %s of type %s" % (f, kind))
102
102
            else:
112
112
 
113
113
        if kind == 'directory':
114
114
            try:
115
 
                sub_branch = Branch(af, find_root=False)
 
115
                sub_branch = Branch.open(af)
116
116
                sub_tree = True
117
117
            except NotBranchError:
118
118
                sub_tree = False