1. TortoiseHg
  2. TortoiseHg
  3. thg

Commits

Hidetaka Iwata  committed e113520

graph: keep ctx instead of revno in parents

  • Participants
  • Parent commits b309d12
  • Branches default

Comments (0)

Files changed (1)

File tortoisehg/hgqt/graph.py

View file
  • Ignore whitespace
         activeedges = [e for e in activeedges if e.endrev < curr_rev]
 
         # Add parents to next_revs.
-        parents = [(p.rev(), LINE_TYPE_PARENT) for p in getparents(ctx)
+        parents = [(p, LINE_TYPE_PARENT) for p in getparents(ctx)
                    if not hidden(p.rev())]
         if showgraftsource:
             src_rev_str = ctx.extra().get('source')
             if src_rev_str is not None and src_rev_str in repo:
-                src_rev = repo[src_rev_str].rev()
+                src = repo[src_rev_str]
+                src_rev = src.rev()
                 if stop_rev <= src_rev < curr_rev and not hidden(src_rev):
-                    parents.append((src_rev, LINE_TYPE_GRAFT))
+                    parents.append((src, LINE_TYPE_GRAFT))
             for octx in obsoleteutil.first_known_precursors(ctx):
                 src_rev = octx.rev()
                 if stop_rev <= src_rev < curr_rev and not hidden(src_rev):
-                    parents.append((src_rev, LINE_TYPE_OBSOLETE))
+                    parents.append((octx, LINE_TYPE_OBSOLETE))
         parents_to_add = []
-        for pno, (parent, link_type) in enumerate(parents):
+        for pno, (pctx, link_type) in enumerate(parents):
+            parent = pctx.rev()
             if parent not in next_revs:
                 # Because the parents originate from multiple sources, it is
                 # theoretically possible that several point to the same
                 if parent in parents_to_add:
                     continue
                 parents_to_add.append(parent)
-            pctx = repo[parent]
             if pno == 0:
                 color = rev_color.get(pctx, rev_color.get(ctx))
             else: