Patchwork hgk: don't break on repositories with obsolete changesets

login
register
mail settings
Submitter Matt Mackall
Date Sept. 29, 2014, 11:01 p.m.
Message ID <1412031660.1528.27.camel@calx>
Download mbox | patch
Permalink /patch/6028/
State Accepted
Commit 271a1ddad1fb68bb158b32c5447eea37d482cf38
Headers show

Comments

Matt Mackall - Sept. 29, 2014, 11:01 p.m.
On Sun, 2014-09-28 at 15:21 +0200, Andrew Shadura wrote:
> # HG changeset patch
> # User Andrew Shadura <andrew@shadura.me>
> # Date 1411910489 -7200
> #      Sun Sep 28 15:21:29 2014 +0200
> # Node ID 2905b2bd3977b438488126bd38734bb64fad1063
> # Parent  dd7041b135cfd4bc1f090a2ee98e30735d738fc5
> hgk: don't break on repositories with obsolete changesets
> 
> Check the existence of a changeset before adding it to the list
> returned by debug-rev-list command.

Queued, but I had to add the following to get it to show the Mercurial
repo:

Patch

diff -r ecd31221ced7 hgext/hgk.py
--- a/hgext/hgk.py	Sun Sep 28 15:21:29 2014 +0200
+++ b/hgext/hgk.py	Mon Sep 29 17:58:24 2014 -0500
@@ -261,6 +261,8 @@ 
     # walk the repository looking for commits that are in our
     # reachability graph
     for i, ctx in chlogwalk():
+        if i not in repo:
+            continue
         n = repo.changelog.node(i)
         mask = is_reachable(want_sha1, reachable, n)
         if mask: