hgext/hgk.py
changeset 3065 32fd512ca7c0
parent 3064 fe5c92529d1c
child 3067 fbd3f9fd645d
equal deleted inserted replaced
3064:fe5c92529d1c 3065:32fd512ca7c0
    84             if not node1:
    84             if not node1:
    85                 node1 = repo.dirstate.parents()[0]
    85                 node1 = repo.dirstate.parents()[0]
    86 
    86 
    87         change = repo.changelog.read(node1)
    87         change = repo.changelog.read(node1)
    88         mmap = repo.manifest.read(change[0])
    88         mmap = repo.manifest.read(change[0])
    89         empty = "0" * 40;
    89         empty = hg.nullid
    90 
    90 
    91         for f in modified:
    91         for f in modified:
    92             # TODO get file permissions
    92             # TODO get file permissions
    93             print ":100664 100664 %s %s M\t%s\t%s" % (hg.short(mmap[f]),
    93             print ":100664 100664 %s %s M\t%s\t%s" % (hg.short(mmap[f]),
    94                                                       hg.short(mmap2[f]),
    94                                                       hg.short(mmap2[f]),
    95                                                       f, f)
    95                                                       f, f)
    96         for f in added:
    96         for f in added:
    97             print ":000000 100664 %s %s N\t%s\t%s" % (empty,
    97             print ":000000 100664 %s %s N\t%s\t%s" % (hg.short(nullid),
    98                                                       hg.short(mmap2[f]),
    98                                                       hg.short(mmap2[f]),
    99                                                       f, f)
    99                                                       f, f)
   100         for f in removed:
   100         for f in removed:
   101             print ":100664 000000 %s %s D\t%s\t%s" % (hg.short(mmap[f]),
   101             print ":100664 000000 %s %s D\t%s\t%s" % (hg.short(mmap[f]),
   102                                                       empty,
   102                                                       hg.short(nullid),
   103                                                       f, f)
   103                                                       f, f)
   104     ##
   104     ##
   105 
   105 
   106     while True:
   106     while True:
   107         if opts['stdin']:
   107         if opts['stdin']: