1. Logilab
  2. Untitled project
  3. hgview


Pierre-Yves David  committed 7e8131d

[status] make dirty working directory detection more robust

A recent glitch in Mercurial code (returning list instead of tuple) highlighted
how fragile this code was.

The new code is more generic and should survive to more upstream changes.

  • Participants
  • Parent commits 24ab527
  • Branches stable

Comments (0)

Files changed (1)

File hgviewlib/hggraph.py

View file
 def _dirty_wc(repo):
     """return true if the working directory has changes"""
-    return repo.status() != ([],)*7  # dirty working dir
+    return bool(sum(len(l) for l in repo.status())) # dirty working dir
 def _rev_order(phaserevs, rev):
     """return a sort key for changeset reordering (<freshness>, rev)