Patchwork D10063: narrow: remove assertion about working copy being clean

login
register
mail settings
Submitter phabricator
Date Feb. 24, 2021, 7:07 a.m.
Message ID <differential-rev-PHID-DREV-3fbnoirfph6uugwywebp-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48378/
State Superseded
Headers show

Comments

phabricator - Feb. 24, 2021, 7:07 a.m.
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




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

Patch

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)