D10063: narrow: remove assertion about working copy being clean

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Feb 24 07:07:01 UTC 2021


martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10063

AFFECTED FILES
  mercurial/narrowspec.py
  tests/test-narrow.t

CHANGE DETAILS

diff --git a/tests/test-narrow.t b/tests/test-narrow.t
--- a/tests/test-narrow.t
+++ b/tests/test-narrow.t
@@ -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
diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -329,7 +329,6 @@
     trackeddirty = status.modified + status.added
     clean = status.clean
     if assumeclean:
-        assert not trackeddirty
         clean.extend(lookup)
     else:
         trackeddirty.extend(lookup)



To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list