# HG changeset patch # User Andrew Shadura # Date 2014-09-28 13:21:29 # Node ID 271a1ddad1fb68bb158b32c5447eea37d482cf38 # Parent 36a940d82f887f2282e5aae3568ec3c47c3a5c68 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. diff --git a/hgext/hgk.py b/hgext/hgk.py --- a/hgext/hgk.py +++ b/hgext/hgk.py @@ -204,10 +204,12 @@ def revtree(ui, args, repo, full="tree", l[chunk - x:] = [0] * (chunk - x) break if full is not None: - l[x] = repo[i + x] - l[x].changeset() # force reading + if (i + x) in repo: + l[x] = repo[i + x] + l[x].changeset() # force reading else: - l[x] = 1 + if (i + x) in repo: + l[x] = 1 for x in xrange(chunk - 1, -1, -1): if l[x] != 0: yield (i + x, full is not None and l[x] or None) @@ -259,6 +261,8 @@ def revtree(ui, args, repo, full="tree", # 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: