[mq] fix ``ev/null`` file entry appearing with removed files on unapplied patches (closes #89335)

authorAlain Leufroy <alain.leufroy@logilab.fr>
changeset451bb3d322d1
branchstable
phasepublic
hiddenno
parent revision#60ae286afdf4 [core] fix OSError while focusing on removed file (closes #87839)
child revision#487237792c36 [TUI|inotify] prevent over refreshing with mercurial 2.1 (closes #89336)
files modified by this revision
hgviewlib/hgpatches/mqsupport.py
# HG changeset patch
# User Alain Leufroy <alain.leufroy@logilab.fr>
# Date 1330109617 -3600
# Fri Feb 24 19:53:37 2012 +0100
# Branch stable
# Node ID 451bb3d322d174cde798bdbaeb5223e96dcadcd8
# Parent 60ae286afdf4aafb4ef1e4930d9dbeac3fffc6b9
[mq] fix ``ev/null`` file entry appearing with removed files on unapplied patches (closes #89335)

diff --git a/hgviewlib/hgpatches/mqsupport.py b/hgviewlib/hgpatches/mqsupport.py
@@ -247,11 +247,14 @@
1      def oldpath(self):
2          return self._oldpath
3 
4      def files(self):
5          """List of modified files"""
6 -        return tuple(path for path in (self._path, self._oldpath) if path)
7 +        return tuple(path for path in (self._path, self._oldpath)
8 +                     if path and not os.devnull.endswith(path))
9 +    # note endswith is used as the complete path have been cut
10 +    # (expecting ``a/`` at the beginning of path)
11 
12      def data(self):
13          """ return the patch hunks"""
14          return self._data
15      __str__ = data