Exemplo n.º 1
0
    def changelist(limit=0, **map):
        l = [] # build a list in forward order for efficiency
        for i in xrange(start, end):
            ctx = web.repo[i]
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            l.insert(0, {"parity": parity.next(),
                         "author": ctx.user(),
                         "parent": webutil.parents(ctx, i - 1),
                         "child": webutil.children(ctx, i + 1),
                         "changelogtag": showtags,
                         "desc": ctx.description(),
                         "date": ctx.date(),
                         "files": files,
                         "rev": i,
                         "node": hex(n),
                         "tags": webutil.nodetagsdict(web.repo, n),
                         "inbranch": webutil.nodeinbranch(web.repo, ctx),
                         "branches": webutil.nodebranchdict(web.repo, ctx)
                        })

        if limit > 0:
            l = l[:limit]

        for e in l:
            yield e
Exemplo n.º 2
0
    def changelist(**map):
        count = 0

        for ctx in searchfunc[0](funcarg):
            count += 1
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            yield tmpl('searchentry',
                       parity=parity.next(),
                       author=ctx.user(),
                       parent=webutil.parents(ctx),
                       child=webutil.children(ctx),
                       changelogtag=showtags,
                       desc=ctx.description(),
                       extra=ctx.extra(),
                       date=ctx.date(),
                       files=files,
                       rev=ctx.rev(),
                       node=hex(n),
                       tags=webutil.nodetagsdict(web.repo, n),
                       bookmarks=webutil.nodebookmarksdict(web.repo, n),
                       inbranch=webutil.nodeinbranch(web.repo, ctx),
                       branches=webutil.nodebranchdict(web.repo, ctx))

            if count >= revcount:
                break
Exemplo n.º 3
0
    def changelist(limit=0, **map):
        l = []  # build a list in forward order for efficiency
        for i in xrange(start, end):
            ctx = web.repo[i]
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            l.insert(
                0, {
                    "parity": parity.next(),
                    "author": ctx.user(),
                    "parent": webutil.parents(ctx, i - 1),
                    "child": webutil.children(ctx, i + 1),
                    "changelogtag": showtags,
                    "desc": ctx.description(),
                    "date": ctx.date(),
                    "files": files,
                    "rev": i,
                    "node": hex(n),
                    "tags": webutil.nodetagsdict(web.repo, n),
                    "inbranch": webutil.nodeinbranch(web.repo, ctx),
                    "branches": webutil.nodebranchdict(web.repo, ctx)
                })

        if limit > 0:
            l = l[:limit]

        for e in l:
            yield e
Exemplo n.º 4
0
    def changelist(**map):
        count = 0

        for ctx in searchfunc[0](funcarg):
            count += 1
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            yield tmpl('searchentry',
                       parity=parity.next(),
                       author=ctx.user(),
                       parent=webutil.parents(ctx),
                       child=webutil.children(ctx),
                       changelogtag=showtags,
                       desc=ctx.description(),
                       extra=ctx.extra(),
                       date=ctx.date(),
                       files=files,
                       rev=ctx.rev(),
                       node=hex(n),
                       tags=webutil.nodetagsdict(web.repo, n),
                       bookmarks=webutil.nodebookmarksdict(web.repo, n),
                       inbranch=webutil.nodeinbranch(web.repo, ctx),
                       branches=webutil.nodebranchdict(web.repo, ctx))

            if count >= revcount:
                break
Exemplo n.º 5
0
    def changelist(latestonly, **map):
        revs = []
        if pos != -1:
            revs = web.repo.changelog.revs(pos, 0)
        if latestonly:
            revs = (revs.next(),)
        curcount = 0
        for i in revs:
            ctx = web.repo[i]
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            curcount += 1
            if curcount > revcount:
                break
            yield {"parity": parity.next(),
                   "author": ctx.user(),
                   "parent": webutil.parents(ctx, i - 1),
                   "child": webutil.children(ctx, i + 1),
                   "changelogtag": showtags,
                   "desc": ctx.description(),
                   "extra": ctx.extra(),
                   "date": ctx.date(),
                   "files": files,
                   "rev": i,
                   "node": hex(n),
                   "tags": webutil.nodetagsdict(web.repo, n),
                   "bookmarks": webutil.nodebookmarksdict(web.repo, n),
                   "inbranch": webutil.nodeinbranch(web.repo, ctx),
                   "branches": webutil.nodebranchdict(web.repo, ctx)
            }
Exemplo n.º 6
0
    def changelist(latestonly, **map):
        l = []  # build a list in forward order for efficiency
        revs = []
        if start < end:
            revs = web.repo.changelog.revs(start, end - 1)
        if latestonly:
            for r in revs:
                pass
            revs = (r, )
        for i in revs:
            ctx = web.repo[i]
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            l.append({
                "parity": parity.next(),
                "author": ctx.user(),
                "parent": webutil.parents(ctx, i - 1),
                "child": webutil.children(ctx, i + 1),
                "changelogtag": showtags,
                "desc": ctx.description(),
                "extra": ctx.extra(),
                "date": ctx.date(),
                "files": files,
                "rev": i,
                "node": hex(n),
                "tags": webutil.nodetagsdict(web.repo, n),
                "bookmarks": webutil.nodebookmarksdict(web.repo, n),
                "inbranch": webutil.nodeinbranch(web.repo, ctx),
                "branches": webutil.nodebranchdict(web.repo, ctx)
            })
        for e in reversed(l):
            yield e
Exemplo n.º 7
0
    def changelist(latestonly, **map):
        l = [] # build a list in forward order for efficiency
        revs = []
        if start < end:
            revs = web.repo.changelog.revs(start, end - 1)
        if latestonly:
            for r in revs:
                pass
            revs = (r,)
        for i in revs:
            ctx = web.repo[i]
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            l.append({"parity": parity.next(),
                      "author": ctx.user(),
                      "parent": webutil.parents(ctx, i - 1),
                      "child": webutil.children(ctx, i + 1),
                      "changelogtag": showtags,
                      "desc": ctx.description(),
                      "extra": ctx.extra(),
                      "date": ctx.date(),
                      "files": files,
                      "rev": i,
                      "node": hex(n),
                      "tags": webutil.nodetagsdict(web.repo, n),
                      "bookmarks": webutil.nodebookmarksdict(web.repo, n),
                      "inbranch": webutil.nodeinbranch(web.repo, ctx),
                      "branches": webutil.nodebranchdict(web.repo, ctx)
                     })
        for e in reversed(l):
            yield e
Exemplo n.º 8
0
    def changelist(latestonly, **map):
        revs = []
        if pos != -1:
            revs = web.repo.changelog.revs(pos, 0)
        if latestonly:
            revs = (revs.next(), )
        curcount = 0
        for i in revs:
            ctx = web.repo[i]
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            curcount += 1
            if curcount > revcount:
                break
            yield {
                "parity": parity.next(),
                "author": ctx.user(),
                "parent": webutil.parents(ctx, i - 1),
                "child": webutil.children(ctx, i + 1),
                "changelogtag": showtags,
                "desc": ctx.description(),
                "extra": ctx.extra(),
                "date": ctx.date(),
                "files": files,
                "rev": i,
                "node": hex(n),
                "tags": webutil.nodetagsdict(web.repo, n),
                "bookmarks": webutil.nodebookmarksdict(web.repo, n),
                "inbranch": webutil.nodeinbranch(web.repo, ctx),
                "branches": webutil.nodebranchdict(web.repo, ctx)
            }
Exemplo n.º 9
0
    def changelist(**map):
        count = 0
        lower = encoding.lower
        qw = lower(query).split()

        def revgen():
            cl = web.repo.changelog
            for i in xrange(len(web.repo) - 1, 0, -100):
                l = []
                for j in cl.revs(max(0, i - 99), i):
                    ctx = web.repo[j]
                    l.append(ctx)
                l.reverse()
                for e in l:
                    yield e

        for ctx in revgen():
            miss = 0
            for q in qw:
                if not (q in lower(ctx.user()) or
                        q in lower(ctx.description()) or
                        q in lower(" ".join(ctx.files()))):
                    miss = 1
                    break
            if miss:
                continue

            count += 1
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            yield tmpl('searchentry',
                       parity=parity.next(),
                       author=ctx.user(),
                       parent=webutil.parents(ctx),
                       child=webutil.children(ctx),
                       changelogtag=showtags,
                       desc=ctx.description(),
                       extra=ctx.extra(),
                       date=ctx.date(),
                       files=files,
                       rev=ctx.rev(),
                       node=hex(n),
                       tags=webutil.nodetagsdict(web.repo, n),
                       bookmarks=webutil.nodebookmarksdict(web.repo, n),
                       inbranch=webutil.nodeinbranch(web.repo, ctx),
                       branches=webutil.nodebranchdict(web.repo, ctx))

            if count >= revcount:
                break
Exemplo n.º 10
0
    def changelist(**map):
        count = 0
        lower = encoding.lower
        qw = lower(query).split()

        def revgen():
            cl = web.repo.changelog
            for i in xrange(len(web.repo) - 1, 0, -100):
                l = []
                for j in cl.revs(max(0, i - 100), i + 1):
                    ctx = web.repo[j]
                    l.append(ctx)
                l.reverse()
                for e in l:
                    yield e

        for ctx in revgen():
            miss = 0
            for q in qw:
                if not (q in lower(ctx.user()) or q in lower(ctx.description())
                        or q in lower(" ".join(ctx.files()))):
                    miss = 1
                    break
            if miss:
                continue

            count += 1
            n = ctx.node()
            showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
            files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)

            yield tmpl('searchentry',
                       parity=parity.next(),
                       author=ctx.user(),
                       parent=webutil.parents(ctx),
                       child=webutil.children(ctx),
                       changelogtag=showtags,
                       desc=ctx.description(),
                       extra=ctx.extra(),
                       date=ctx.date(),
                       files=files,
                       rev=ctx.rev(),
                       node=hex(n),
                       tags=webutil.nodetagsdict(web.repo, n),
                       bookmarks=webutil.nodebookmarksdict(web.repo, n),
                       inbranch=webutil.nodeinbranch(web.repo, ctx),
                       branches=webutil.nodebranchdict(web.repo, ctx))

            if count >= revcount:
                break