mercurial/commands.py
changeset 778 d09975474928
parent 773 d77c1031fd17
child 779 b3c7cb74d325
equal deleted inserted replaced
777:8a61f25414b5 778:d09975474928
   215         ui.write("%d:%s\n" % (rev, hg.hex(node)))
   215         ui.write("%d:%s\n" % (rev, hg.hex(node)))
   216         return
   216         return
   217 
   217 
   218     changes = changelog.read(changenode)
   218     changes = changelog.read(changenode)
   219 
   219 
   220     parents = [(log.rev(parent), hg.hex(parent))
   220     parents = [(log.rev(p), ui.verbose and hg.hex(p) or hg.short(p))
   221                for parent in log.parents(node)
   221                for p in log.parents(node)
   222                if ui.debugflag or parent != hg.nullid]
   222                if ui.debugflag or p != hg.nullid]
   223     if not ui.debugflag and len(parents) == 1 and parents[0][0] == rev-1:
   223     if not ui.debugflag and len(parents) == 1 and parents[0][0] == rev-1:
   224         parents = []
   224         parents = []
   225 
   225 
   226     ui.write("changeset:   %d:%s\n" % (changerev, hg.hex(changenode)))
   226     if ui.verbose:
       
   227         ui.write("changeset:   %d:%s\n" % (changerev, hg.hex(changenode)))
       
   228     else:
       
   229         ui.write("changeset:   %d:%s\n" % (changerev, hg.short(changenode)))
       
   230 
   227     for tag in repo.nodetags(changenode):
   231     for tag in repo.nodetags(changenode):
   228         ui.status("tag:         %s\n" % tag)
   232         ui.status("tag:         %s\n" % tag)
   229     for parent in parents:
   233     for parent in parents:
   230         ui.write("parent:      %d:%s\n" % parent)
   234         ui.write("parent:      %d:%s\n" % parent)
   231     if filelog:
   235     if filelog:
   232         ui.debug("file rev:    %d:%s\n" % (filerev, hg.hex(filenode)))
   236         ui.debug("file rev:    %d:%s\n" % (filerev, hg.hex(filenode)))
   233     ui.note("manifest:    %d:%s\n" % (repo.manifest.rev(changes[0]),
   237 
       
   238     ui.debug("manifest:    %d:%s\n" % (repo.manifest.rev(changes[0]),
   234                                       hg.hex(changes[0])))
   239                                       hg.hex(changes[0])))
   235     ui.status("user:        %s\n" % changes[1])
   240     ui.status("user:        %s\n" % changes[1])
   236     ui.status("date:        %s\n" % time.asctime(
   241     ui.status("date:        %s\n" % time.asctime(
   237         time.localtime(float(changes[2].split(' ')[0]))))
   242         time.localtime(float(changes[2].split(' ')[0]))))
       
   243 
   238     if ui.debugflag:
   244     if ui.debugflag:
   239         files = repo.changes(changelog.parents(changenode)[0], changenode)
   245         files = repo.changes(changelog.parents(changenode)[0], changenode)
   240         for key, value in zip(["files:", "files+:", "files-:"], files):
   246         for key, value in zip(["files:", "files+:", "files-:"], files):
   241             if value:
   247             if value:
   242                 ui.note("%-12s %s\n" % (key, " ".join(value)))
   248                 ui.note("%-12s %s\n" % (key, " ".join(value)))
   243     else:
   249     else:
   244         ui.note("files:       %s\n" % " ".join(changes[3]))
   250         ui.note("files:       %s\n" % " ".join(changes[3]))
       
   251 
   245     description = changes[4].strip()
   252     description = changes[4].strip()
   246     if description:
   253     if description:
   247         if ui.verbose:
   254         if ui.verbose:
   248             ui.status("description:\n")
   255             ui.status("description:\n")
   249             ui.status(description)
   256             ui.status(description)