hgext/hgk.py
changeset 6747 f6c00b17387c
parent 6666 53465a7464e2
child 6750 fb42030d79d6
equal deleted inserted replaced
6746:1dca460e7d1e 6747:f6c00b17387c
    50 
    50 
    51 def difftree(ui, repo, node1=None, node2=None, *files, **opts):
    51 def difftree(ui, repo, node1=None, node2=None, *files, **opts):
    52     """diff trees from two commits"""
    52     """diff trees from two commits"""
    53     def __difftree(repo, node1, node2, files=[]):
    53     def __difftree(repo, node1, node2, files=[]):
    54         assert node2 is not None
    54         assert node2 is not None
    55         mmap = repo.changectx(node1).manifest()
    55         mmap = repo[node1].manifest()
    56         mmap2 = repo.changectx(node2).manifest()
    56         mmap2 = repo[node2].manifest()
    57         m = cmdutil.match(repo, files)
    57         m = cmdutil.match(repo, files)
    58         status = repo.status(node1, node2, match=m)[:5]
    58         status = repo.status(node1, node2, match=m)[:5]
    59         modified, added, removed, deleted, unknown = status
    59         modified, added, removed, deleted, unknown = status
    60 
    60 
    61         empty = short(nullid)
    61         empty = short(nullid)
   101             break
   101             break
   102 
   102 
   103 def catcommit(ui, repo, n, prefix, ctx=None):
   103 def catcommit(ui, repo, n, prefix, ctx=None):
   104     nlprefix = '\n' + prefix;
   104     nlprefix = '\n' + prefix;
   105     if ctx is None:
   105     if ctx is None:
   106         ctx = repo.changectx(n)
   106         ctx = repo[n]
   107     (p1, p2) = ctx.parents()
   107     (p1, p2) = ctx.parents()
   108     ui.write("tree %s\n" % short(ctx.changeset()[0])) # use ctx.node() instead ??
   108     ui.write("tree %s\n" % short(ctx.changeset()[0])) # use ctx.node() instead ??
   109     if p1: ui.write("parent %s\n" % short(p1.node()))
   109     if p1: ui.write("parent %s\n" % short(p1.node()))
   110     if p2: ui.write("parent %s\n" % short(p2.node()))
   110     if p2: ui.write("parent %s\n" % short(p2.node()))
   111     date = ctx.date()
   111     date = ctx.date()
   189             for x in xrange(0, chunk):
   189             for x in xrange(0, chunk):
   190                 if i + x >= count:
   190                 if i + x >= count:
   191                     l[chunk - x:] = [0] * (chunk - x)
   191                     l[chunk - x:] = [0] * (chunk - x)
   192                     break
   192                     break
   193                 if full != None:
   193                 if full != None:
   194                     l[x] = repo.changectx(i + x)
   194                     l[x] = repo[i + x]
   195                     l[x].changeset() # force reading
   195                     l[x].changeset() # force reading
   196                 else:
   196                 else:
   197                     l[x] = 1
   197                     l[x] = 1
   198             for x in xrange(chunk-1, -1, -1):
   198             for x in xrange(chunk-1, -1, -1):
   199                 if l[x] != 0:
   199                 if l[x] != 0: