예제 #1
0
        def filectxfn(repo, memctx, path):
            current_file = files[path]
            try:
                data, isexec, islink, copied = current.pop(current_file)
            except IOError:
                return compathacks.filectxfn_deleted_reraise(memctx)
            if isexec is None or islink is None:
                flags = parentctx.flags(path)
                if isexec is None:
                    isexec = 'x' in flags
                if islink is None:
                    islink = 'l' in flags

            if data is not None:
                if islink:
                    if data.startswith('link '):
                        data = data[len('link '):]
                    else:
                        ui.debug('file marked as link, but may contain data: '
                                 '%s\n' % current_file)
            else:
                data = parentctx.filectx(path).data()
            return compathacks.makememfilectx(repo,
                                              path=path,
                                              data=data,
                                              islink=islink,
                                              isexec=isexec,
                                              copied=copied)
예제 #2
0
        def filectxfn(repo, memctx, path):
            current_file = files[path]
            try:
                data, isexec, islink, copied = current.pop(current_file)
            except IOError:
                return compathacks.filectxfn_deleted_reraise(memctx)
            if isexec is None or islink is None:
                flags = parentctx.flags(path)
                if isexec is None:
                    isexec = 'x' in flags
                if islink is None:
                    islink = 'l' in flags

            if data is not None:
                if islink:
                    if data.startswith('link '):
                        data = data[len('link '):]
                    else:
                        ui.debug('file marked as link, but may contain data: '
                            '%s\n' % current_file)
            else:
                data = parentctx.filectx(path).data()
            return compathacks.makememfilectx(repo,
                                              path=path,
                                              data=data,
                                              islink=islink,
                                              isexec=isexec,
                                              copied=copied)
예제 #3
0
 def filectxfn(repo, memctx, path):
     svnpath = path
     if branchpath:
         svnpath = branchpath + '/' + path
     try:
         data, mode = svn.get_file(svnpath, r.revnum)
     except IOError:
         return compathacks.filectxfn_deleted_reraise(memctx)
     isexec = 'x' in mode
     islink = 'l' in mode
     copied = copies.get(path)
     # TODO this branch feels like it should not be required,
     # and this may actually imply a bug in getcopies
     if copied not in parentctx.manifest():
         copied = None
     return compathacks.makememfilectx(repo,
                                       path=path,
                                       data=data,
                                       islink=islink,
                                       isexec=isexec,
                                       copied=copied)
예제 #4
0
 def filectxfn(repo, memctx, path):
     svnpath = path
     if branchpath:
         svnpath = branchpath + '/' + path
     try:
         data, mode = svn.get_file(svnpath, r.revnum)
     except IOError:
         return compathacks.filectxfn_deleted_reraise(memctx)
     isexec = 'x' in mode
     islink = 'l' in mode
     copied = copies.get(path)
     # TODO this branch feels like it should not be required,
     # and this may actually imply a bug in getcopies
     if copied not in parentctx.manifest():
         copied = None
     return compathacks.makememfilectx(repo,
                                       path=path,
                                       data=data,
                                       islink=islink,
                                       isexec=isexec,
                                       copied=copied)
예제 #5
0
    def filectxfn(repo, memctx, path):
        if path in files_data and files_data[path] is None:
            return compathacks.filectxfn_deleted(memctx, path)

        if path in binary_files or path in unknown_files:
            pa = path
            if branchpath:
                pa = branchpath + '/' + path
            try:
                data, mode = svn.get_file(pa, r.revnum)
            except IOError:
                return compathacks.filectxfn_deleted_reraise(memctx)
            isexe = 'x' in mode
            islink = 'l' in mode
        else:
            isexe = exec_files.get(path, 'x' in parentctx.flags(path))
            islink = link_files.get(path, 'l' in parentctx.flags(path))
            data = ''
            if path in files_data:
                data = files_data[path]
                if islink:
                    data = data[len('link '):]
            elif path in parentctx:
                data = parentctx[path].data()

        copied = copies.get(path)
        # TODO this branch feels like it should not be required,
        # and this may actually imply a bug in getcopies
        if copied not in parentctx.manifest():
            copied = None
        return compathacks.makememfilectx(repo,
                                          memctx=memctx,
                                          path=path,
                                          data=data,
                                          islink=islink,
                                          isexec=isexe,
                                          copied=copied)
예제 #6
0
    def filectxfn(repo, memctx, path):
        if path in files_data and files_data[path] is None:
            return compathacks.filectxfn_deleted(memctx, path)

        if path in binary_files or path in unknown_files:
            pa = path
            if branchpath:
                pa = branchpath + '/' + path
            try:
                data, mode = svn.get_file(pa, r.revnum)
            except IOError:
                return compathacks.filectxfn_deleted_reraise(memctx)
            isexe = 'x' in mode
            islink = 'l' in mode
        else:
            isexe = exec_files.get(path, 'x' in parentctx.flags(path))
            islink = link_files.get(path, 'l' in parentctx.flags(path))
            data = ''
            if path in files_data:
                data = files_data[path]
                if islink:
                    data = data[len('link '):]
            elif path in parentctx:
                data = parentctx[path].data()

        copied = copies.get(path)
        # TODO this branch feels like it should not be required,
        # and this may actually imply a bug in getcopies
        if copied not in parentctx.manifest():
            copied = None
        return compathacks.makememfilectx(repo,
                                          path=path,
                                          data=data,
                                          islink=islink,
                                          isexec=isexe,
                                          copied=copied)