clfilter: stronger detection of filtered changeset in changectx.__init__
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 16 Jan 2013 05:21:11 +0100
changeset 18423 5d6ee2494f63
parent 18422 f009804e2a43
child 18424 100fdc84670f
clfilter: stronger detection of filtered changeset in changectx.__init__ We previously let some IndexError spill out of this function. A new tests is added to check the command that spotted the error.
mercurial/context.py
tests/test-obsolete.t
--- a/mercurial/context.py	Tue Dec 11 20:13:21 2012 +0100
+++ b/mercurial/context.py	Wed Jan 16 05:21:11 2013 +0100
@@ -67,7 +67,7 @@
             self._rev = r
             self._node = repo.changelog.node(r)
             return
-        except (ValueError, OverflowError):
+        except (ValueError, OverflowError, IndexError):
             pass
 
         if len(changeid) == 40:
--- a/tests/test-obsolete.t	Tue Dec 11 20:13:21 2012 +0100
+++ b/tests/test-obsolete.t	Wed Jan 16 05:21:11 2013 +0100
@@ -186,6 +186,23 @@
   update: 3 new changesets, 4 branch heads (merge)
   remote: 3 outgoing
 
+check that various commands work well with filtering
+
+  $ hg tip
+  changeset:   5:5601fb93a350
+  tag:         tip
+  parent:      1:7c3bad9141dc
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add new_3_c
+  
+  $ hg log -r 6
+  abort: unknown revision '6'!
+  [255]
+  $ hg log -r 4
+  abort: unknown revision '4'!
+  [255]
+
 Check that public changeset are not accounted as obsolete:
 
   $ hg --hidden phase --public 2