narrow: add more status messages when narrowing
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.
Differential Revision: https://phab.mercurial-scm.org/D10503
--- a/hgext/narrow/narrowcommands.py Tue Apr 20 10:24:03 2021 -0700
+++ b/hgext/narrow/narrowcommands.py Tue Apr 20 11:22:35 2021 -0700
@@ -281,6 +281,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)
@@ -316,6 +320,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)
--- a/tests/test-narrow-clone-non-narrow-server.t Tue Apr 20 10:24:03 2021 -0700
+++ b/tests/test-narrow-clone-non-narrow-server.t Tue Apr 20 11:22:35 2021 -0700
@@ -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
--- a/tests/test-narrow-patterns.t Tue Apr 20 10:24:03 2021 -0700
+++ b/tests/test-narrow-patterns.t Tue Apr 20 11:22:35 2021 -0700
@@ -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
--- a/tests/test-narrow-share.t Tue Apr 20 10:24:03 2021 -0700
+++ b/tests/test-narrow-share.t Tue Apr 20 11:22:35 2021 -0700
@@ -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
--- a/tests/test-narrow-trackedcmd.t Tue Apr 20 10:24:03 2021 -0700
+++ b/tests/test-narrow-trackedcmd.t Tue Apr 20 11:22:35 2021 -0700
@@ -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
--- a/tests/test-narrow.t Tue Apr 20 10:24:03 2021 -0700
+++ b/tests/test-narrow.t Tue Apr 20 11:22:35 2021 -0700
@@ -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