diff tests/test-sparse-import.t @ 33324:33d0859c37bd

sparse: move working directory refreshing into core This is a pretty straightforward move of the code. I converted the "force" argument to a keyword argument. Like other recent changes, this code is tightly coupled with working directory update code in merge.py. I suspect the code will become more tightly coupled over time, possibly even moved to merge.py. For now, let's get the code in core.
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 06 Jul 2017 14:53:08 -0700
parents c9cbf4de27ba
children 5c2a4f37eace
line wrap: on
line diff
--- a/tests/test-sparse-import.t	Thu Jul 06 16:29:31 2017 -0700
+++ b/tests/test-sparse-import.t	Thu Jul 06 14:53:08 2017 -0700
@@ -147,16 +147,11 @@
 If importing results in no new rules being added, no refresh should take place!
 
   $ cat > $TESTTMP/trap_sparse_refresh.py <<EOF
-  > from mercurial import error, extensions
+  > from mercurial import error, sparse
   > def extsetup(ui):
-  >     def abort_refresh(ui, *args):
+  >     def abort_refresh(*args, **kwargs):
   >         raise error.Abort('sparse._refresh called!')
-  >     def sparseloaded(loaded):
-  >         if not loaded:
-  >             return
-  >         sparse = extensions.find('sparse')
-  >         sparse._refresh = abort_refresh
-  >     extensions.afterloaded('sparse', sparseloaded)
+  >     sparse.refreshwdir = abort_refresh
   > EOF
   $ cat >> $HGRCPATH <<EOF
   > [extensions]