Patchwork D10503: narrow: add more status messages when narrowing

login
register
mail settings
Submitter phabricator
Date April 20, 2021, 7:08 p.m.
Message ID <differential-rev-PHID-DREV-f3d4mouwdalzfswqlvfz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48820/
State Superseded
Headers show

Comments

phabricator - April 20, 2021, 7:08 p.m.
martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Each of the steps I added status messages for in this patch frequently
  take minutes or tens of minutes for our internal users.
  
  It would be nice to also have a progress bar but that will have to
  come later.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py
  tests/test-narrow-clone-non-narrow-server.t
  tests/test-narrow-patterns.t
  tests/test-narrow-share.t
  tests/test-narrow-trackedcmd.t
  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
@@ -132,12 +132,14 @@ 
   looking for local changes to affected paths
   The following changeset(s) or their ancestors have local changes not on the remote:
   * (glob)
+  moving unwanted changesets to backup
   saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
   deleting data/d0/f.i (reporevlogstore !)
   deleting meta/d0/00manifest.i (tree !)
   deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
   deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !)
   deleting data/d0/f/index (reposimplestore !)
+  deleting unwanted files from working copy
 
   $ hg log -T "{rev}: {desc} {outsidenarrow}\n"
   7: local change to d3 
@@ -164,12 +166,14 @@ 
   comparing with ssh://user@dummy/master
   searching for changes
   looking for local changes to affected paths
+  moving unwanted changesets to backup
   saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
   deleting data/d0/f.i (reporevlogstore !)
   deleting meta/d0/00manifest.i (tree !)
   deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
   deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !)
   deleting data/d0/f/index (reposimplestore !)
+  deleting unwanted files from working copy
 
 Updates off of stripped commit if necessary
   $ hg co -r 'desc("local change to d3")' -q
@@ -183,12 +187,14 @@ 
   * (glob)
   * (glob)
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  moving unwanted changesets to backup
   saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
   deleting data/d3/f.i (reporevlogstore !)
   deleting meta/d3/00manifest.i (tree !)
   deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
   deleting data/d3/f/99fa7136105a15e2045ce3d9152e4837c5349e4d (reposimplestore !)
   deleting data/d3/f/index (reposimplestore !)
+  deleting unwanted files from working copy
   $ hg log -T '{desc}\n' -r .
   add d10/f
 Updates to nullid if necessary
@@ -206,12 +212,14 @@ 
   The following changeset(s) or their ancestors have local changes not on the remote:
   * (glob)
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  moving unwanted changesets to backup
   saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
   deleting data/d3/f.i (reporevlogstore !)
   deleting meta/d3/00manifest.i (tree !)
   deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
   deleting data/d3/f/5ce0767945cbdbca3b924bb9fbf5143f72ab40ac (reposimplestore !)
   deleting data/d3/f/index (reposimplestore !)
+  deleting unwanted files from working copy
   $ hg id
   000000000000
   $ cd ..
@@ -272,6 +280,7 @@ 
   deleting meta/d0/00manifest.i (tree !)
   deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
   deleting data/d0/f/index (reposimplestore !)
+  deleting unwanted files from working copy
   $ hg tracked
   $ hg files
   [1]
@@ -332,6 +341,7 @@ 
   deleting meta/d6/00manifest.i (tree !)
   deleting data/d6/f/7339d30678f451ac8c3f38753beeb4cf2e1655c7 (reposimplestore !)
   deleting data/d6/f/index (reposimplestore !)
+  deleting unwanted files from working copy
   $ hg tracked
   I path:d0
   I path:d3
@@ -355,6 +365,7 @@ 
   deleting data/d3/f.i (reporevlogstore !)
   deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
   deleting data/d3/f/index (reposimplestore !)
+  deleting unwanted files from working copy
   $ hg tracked
   I path:d0
   I path:d3
@@ -378,6 +389,7 @@ 
   deleting meta/d0/00manifest.i (tree !)
   deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
   deleting data/d0/f/index (reposimplestore !)
+  deleting unwanted files from working copy
   $ hg tracked
   I path:d3
   I path:d9
@@ -478,11 +490,13 @@ 
   path:d2
   remove these unused includes (yn)? y
   looking for local changes to affected paths
+  moving unwanted changesets to backup
   saved backup bundle to $TESTTMP/narrow-auto-remove/.hg/strip-backup/*-narrow.hg (glob)
   deleting data/d0/f.i
   deleting data/d2/f.i
   deleting meta/d0/00manifest.i (tree !)
   deleting meta/d2/00manifest.i (tree !)
+  deleting unwanted files from working copy
   $ hg tracked
   I path:d1
   $ hg files
@@ -504,10 +518,12 @@ 
   path:d2
   remove these unused includes (yn)? y
   looking for local changes to affected paths
+  deleting unwanted changesets
   deleting data/d0/f.i
   deleting data/d2/f.i
   deleting meta/d0/00manifest.i (tree !)
   deleting meta/d2/00manifest.i (tree !)
+  deleting unwanted files from working copy
   $ ls .hg/strip-backup/
 
 
@@ -521,4 +537,5 @@ 
   looking for local changes to affected paths
   deleting data/d0/f.i
   deleting meta/d0/00manifest.i (tree !)
+  deleting unwanted files from working copy
   not deleting possibly dirty file d0/f
diff --git a/tests/test-narrow-trackedcmd.t b/tests/test-narrow-trackedcmd.t
--- a/tests/test-narrow-trackedcmd.t
+++ b/tests/test-narrow-trackedcmd.t
@@ -150,6 +150,7 @@ 
   looking for local changes to affected paths
   deleting data/inside/f.i
   deleting meta/inside/00manifest.i (tree !)
+  deleting unwanted files from working copy
   saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
   adding changesets
   adding manifests
@@ -191,6 +192,7 @@ 
   looking for local changes to affected paths
   deleting data/widest/f.i
   deleting meta/widest/00manifest.i (tree !)
+  deleting unwanted files from working copy
   $ hg tracked
   I path:outisde
   I path:wider
diff --git a/tests/test-narrow-share.t b/tests/test-narrow-share.t
--- a/tests/test-narrow-share.t
+++ b/tests/test-narrow-share.t
@@ -94,6 +94,7 @@ 
   deleting meta/d1/00manifest.i (tree !)
   deleting meta/d3/00manifest.i (tree !)
   deleting meta/d5/00manifest.i (tree !)
+  deleting unwanted files from working copy
   $ hg -R main tracked
   I path:d7
   $ hg -R main files
diff --git a/tests/test-narrow-patterns.t b/tests/test-narrow-patterns.t
--- a/tests/test-narrow-patterns.t
+++ b/tests/test-narrow-patterns.t
@@ -193,6 +193,7 @@ 
   deleting data/dir1/dirA/bar.i (reporevlogstore !)
   deleting data/dir1/dirA/bar/0eca1d0cbdaea4651d1d04d71976a6d2d9bfaae5 (reposimplestore !)
   deleting data/dir1/dirA/bar/index (reposimplestore !)
+  deleting unwanted files from working copy
   saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
   adding changesets
   adding manifests
@@ -249,6 +250,7 @@ 
   deleting data/dir1/dirA/foo.i (reporevlogstore !)
   deleting data/dir1/dirA/foo/162caeb3d55dceb1fee793aa631ac8c73fcb8b5e (reposimplestore !)
   deleting data/dir1/dirA/foo/index (reposimplestore !)
+  deleting unwanted files from working copy
   saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
   adding changesets
   adding manifests
diff --git a/tests/test-narrow-clone-non-narrow-server.t b/tests/test-narrow-clone-non-narrow-server.t
--- a/tests/test-narrow-clone-non-narrow-server.t
+++ b/tests/test-narrow-clone-non-narrow-server.t
@@ -57,6 +57,7 @@ 
   comparing with http://localhost:$HGPORT1/
   searching for changes
   looking for local changes to affected paths
+  deleting unwanted files from working copy
 
   $ hg tracked --addinclude f1 http://localhost:$HGPORT1/
   nothing to widen or narrow
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -282,6 +282,10 @@ 
                 )
                 hg.clean(repo, urev)
             overrides = {(b'devel', b'strip-obsmarkers'): False}
+            if backup:
+                ui.status(_(b'moving unwanted changesets to backup\n'))
+            else:
+                ui.status(_(b'deleting unwanted changesets\n'))
             with ui.configoverride(overrides, b'narrow'):
                 repair.strip(ui, unfi, tostrip, topic=b'narrow', backup=backup)
 
@@ -317,6 +321,7 @@ 
                 util.unlinkpath(repo.svfs.join(f))
                 repo.store.markremoved(f)
 
+            ui.status(_(b'deleting unwanted files from working copy\n'))
             narrowspec.updateworkingcopy(repo, assumeclean=True)
             narrowspec.copytoworkingcopy(repo)