outgoing: fix possible filtering crash in outgoing (issue3814) stable
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Sat, 09 Feb 2013 17:54:01 +0000
branchstable
changeset 18617 227479f61db9
parent 18580 9a06aab5981b
child 18618 43ffd0279876
child 18657 d4a79e075303
outgoing: fix possible filtering crash in outgoing (issue3814) If there is no outgoiing changesets but we have filtered revision in outgoing.excluded We run into a filtering related crash. The excluded revision should not be there in the first place but discovery need cleanup in default, not stable.
mercurial/scmutil.py
tests/test-obsolete.t
--- a/mercurial/scmutil.py	Fri Feb 08 23:13:47 2013 +0000
+++ b/mercurial/scmutil.py	Sat Feb 09 17:54:01 2013 +0000
@@ -18,6 +18,10 @@
     secretlist = []
     if excluded:
         for n in excluded:
+            if n not in repo:
+                # discovery should not have included the filtered revision,
+                # we have to explicitly exclude it until discovery is cleanup.
+                continue
             ctx = repo[n]
             if ctx.phase() >= phases.secret and not ctx.extinct():
                 secretlist.append(n)
--- a/tests/test-obsolete.t	Fri Feb 08 23:13:47 2013 +0000
+++ b/tests/test-obsolete.t	Sat Feb 09 17:54:01 2013 +0000
@@ -865,3 +865,25 @@
   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
 
 #endif
+
+This test issue 3814
+
+(nothing to push but locally hidden changeset)
+
+  $ cd ..
+  $ hg init repo-issue3814
+  $ cd repo-issue3805
+  $ hg push -r 3816541e5485 ../repo-issue3814
+  pushing to ../repo-issue3814
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  $ hg out ../repo-issue3814
+  comparing with ../repo-issue3814
+  searching for changes
+  no changes found
+  [1]
+
+