コード例 #1
0
ファイル: stupid.py プロジェクト: fuzzball81/dotfiles
def patchrepo(ui, meta, parentctx, patchfp):
    store = patch.filestore(util.getfilestoresize(ui))
    try:
        touched = set()
        backend = svnbackend(ui, meta.repo, parentctx, store)

        try:
            try:
                ret = patch.patchbackend(ui, backend, patchfp, 0, files=touched)
            except TypeError:
                # Mercurial >= 3.4 have an extra prefix parameter
                ret = patch.patchbackend(ui, backend, patchfp, 0, '',
                                         files=touched)
            if ret < 0:
                raise BadPatchApply('patching failed')
            if ret > 0:
                raise BadPatchApply('patching succeeded with fuzz')
        except patch.PatchError, e:
            raise BadPatchApply(str(e))

        files = {}
        for f in touched:
            try:
                data, mode, copied = store.getfile(f)
                files[f] = data
            except IOError:
                files[f] = None
        return files
コード例 #2
0
def patchrepo(ui, meta, parentctx, patchfp):
    store = patch.filestore(util.getfilestoresize(ui))
    try:
        touched = set()
        backend = svnbackend(ui, meta.repo, parentctx, store)

        try:
            try:
                ret = patch.patchbackend(ui, backend, patchfp, 0, files=touched)
            except TypeError:
                # Mercurial >= 3.4 have an extra prefix parameter
                ret = patch.patchbackend(ui, backend, patchfp, 0, '',
                                         files=touched)
            if ret < 0:
                raise BadPatchApply('patching failed')
            if ret > 0:
                raise BadPatchApply('patching succeeded with fuzz')
        except patch.PatchError, e:
            raise BadPatchApply(str(e))

        files = {}
        for f in touched:
            try:
                data, mode, copied = store.getfile(f)
                files[f] = data
            except IOError:
                files[f] = None
        return files
コード例 #3
0
ファイル: stupid.py プロジェクト: avuori/dotfiles
def patchrepo(ui, meta, parentctx, patchfp):
    if not svnbackend:
        return patchrepoold(ui, meta, parentctx, patchfp)
    store = patch.filestore()
    try:
        touched = set()
        backend = svnbackend(ui, meta.repo, parentctx, store)
        ret = patch.patchbackend(ui, backend, patchfp, 0, touched)
        if ret < 0:
            raise BadPatchApply("patching failed")
        if ret > 0:
            raise BadPatchApply("patching succeeded with fuzz")
        files = {}
        for f in touched:
            try:
                data, mode, copied = store.getfile(f)
                files[f] = data
            except IOError:
                files[f] = None
        return files
    finally:
        store.close()