narrow: remove assertion about working copy being clean
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 23 Feb 2021 22:58:30 -0800
changeset 46645 ced66295ea90
parent 46644 946a07f08906
child 46646 e9901d01d135
narrow: remove assertion about working copy being clean The user can always modify the working copy, including while they're running `hg tracked --remove-include <path>`. Nothing really bad happens when they do that, and we already have code for printing a nice warning, so we can safely remove the assertion we had. Differential Revision: https://phab.mercurial-scm.org/D10063
mercurial/narrowspec.py
tests/test-narrow.t
--- a/mercurial/narrowspec.py	Tue Feb 23 22:55:26 2021 -0800
+++ b/mercurial/narrowspec.py	Tue Feb 23 22:58:30 2021 -0800
@@ -329,7 +329,6 @@
     trackeddirty = status.modified + status.added
     clean = status.clean
     if assumeclean:
-        assert not trackeddirty
         clean.extend(lookup)
     else:
         trackeddirty.extend(lookup)
--- a/tests/test-narrow.t	Tue Feb 23 22:55:26 2021 -0800
+++ b/tests/test-narrow.t	Tue Feb 23 22:58:30 2021 -0800
@@ -515,5 +515,10 @@
   $ hg clone --narrow ssh://user@dummy/master narrow-concurrent-modify -q \
   > --include d0 --include d1
   $ cd narrow-concurrent-modify
-  $ hg --config 'hooks.pretxnopen = echo modified >> d0/f' tracked --removeinclude d0 2>&1 | grep AssertionError
-  AssertionError
+  $ hg --config 'hooks.pretxnopen = echo modified >> d0/f' tracked --removeinclude d0
+  comparing with ssh://user@dummy/master
+  searching for changes
+  looking for local changes to affected paths
+  deleting data/d0/f.i
+  deleting meta/d0/00manifest.i (tree !)
+  not deleting possibly dirty file d0/f