merge to stable for 5.3 release freeze stable 5.3rc0
authorAugie Fackler <augie@google.com>
Tue, 21 Jan 2020 13:14:51 -0500
branchstable
changeset 44129 84a0102c05c7
parent 44048 61881b170140 (diff)
parent 44128 ff396501e841 (current diff)
child 44130 266c42c60183
merge to stable for 5.3 release freeze
hgext/fix.py
hgext/largefiles/overrides.py
tests/test-fix.t
--- a/hgext/fix.py	Fri Jan 17 16:56:49 2020 -0500
+++ b/hgext/fix.py	Tue Jan 21 13:14:51 2020 -0500
@@ -103,7 +103,7 @@
     to the file content. Provides "$HG_REV" and "$HG_PATH" to identify the file,
     and "$HG_METADATA" with a map of fixer names to metadata values from fixer
     tools that affected the file. Fixer tools that didn't affect the file have a
-    valueof None. Only fixer tools that executed are present in the metadata.
+    value of None. Only fixer tools that executed are present in the metadata.
 
   "postfix"
     Run once after all files and revisions have been handled. Provides
@@ -114,7 +114,7 @@
     executions that modified a file. This aggregates the same metadata
     previously passed to the "postfixfile" hook.
 
-Fixer tools are run the in repository's root directory. This allows them to read
+Fixer tools are run in the repository's root directory. This allows them to read
 configuration files from the working copy, or even write to the working copy.
 The working copy is not updated to match the revision being fixed. In fact,
 several revisions may be fixed in parallel. Writes to the working copy are not
--- a/hgext/largefiles/overrides.py	Fri Jan 17 16:56:49 2020 -0500
+++ b/hgext/largefiles/overrides.py	Tue Jan 21 13:14:51 2020 -0500
@@ -1199,7 +1199,16 @@
             sub = ctx.workingsub(subpath)
             submatch = matchmod.subdirmatcher(subpath, match)
             subprefix = prefix + subpath + b'/'
-            with lfstatus(sub._repo):
+
+            # TODO: Only hgsubrepo instances have `_repo`, so figure out how to
+            # infer and possibly set lfstatus in hgsubrepoarchive.  That would
+            # allow only hgsubrepos to set this, instead of the current scheme
+            # where the parent sets this for the child.
+            with (
+                util.safehasattr(sub, '_repo')
+                and lfstatus(sub._repo)
+                or util.nullcontextmanager()
+            ):
                 sub.archive(archiver, subprefix, submatch)
 
     archiver.done()
@@ -1257,7 +1266,15 @@
         sub = ctx.workingsub(subpath)
         submatch = matchmod.subdirmatcher(subpath, match)
         subprefix = prefix + subpath + b'/'
-        with lfstatus(sub._repo):
+        # TODO: Only hgsubrepo instances have `_repo`, so figure out how to
+        # infer and possibly set lfstatus at the top of this function.  That
+        # would allow only hgsubrepos to set this, instead of the current scheme
+        # where the parent sets this for the child.
+        with (
+            util.safehasattr(sub, '_repo')
+            and lfstatus(sub._repo)
+            or util.nullcontextmanager()
+        ):
             sub.archive(archiver, subprefix, submatch, decode)
 
 
--- a/mercurial/progress.py	Fri Jan 17 16:56:49 2020 -0500
+++ b/mercurial/progress.py	Tue Jan 21 13:14:51 2020 -0500
@@ -193,6 +193,7 @@
         if not self.printed or not self.lastprint or not shouldprint(self.ui):
             return
         self._writeerr(b'\r%s\r' % (b' ' * self.width()))
+        self._flusherr()
         if self.printed:
             # force immediate re-paint of progress bar
             self.lastprint = 0
--- a/tests/test-fix.t	Fri Jan 17 16:56:49 2020 -0500
+++ b/tests/test-fix.t	Tue Jan 21 13:14:51 2020 -0500
@@ -215,7 +215,7 @@
       to the file content. Provides "$HG_REV" and "$HG_PATH" to identify the file,
       and "$HG_METADATA" with a map of fixer names to metadata values from fixer
       tools that affected the file. Fixer tools that didn't affect the file have a
-      valueof None. Only fixer tools that executed are present in the metadata.
+      value of None. Only fixer tools that executed are present in the metadata.
   
     "postfix"
       Run once after all files and revisions have been handled. Provides
@@ -226,7 +226,7 @@
       executions that modified a file. This aggregates the same metadata
       previously passed to the "postfixfile" hook.
   
-  Fixer tools are run the in repository's root directory. This allows them to
+  Fixer tools are run in the repository's root directory. This allows them to
   read configuration files from the working copy, or even write to the working
   copy. The working copy is not updated to match the revision being fixed. In
   fact, several revisions may be fixed in parallel. Writes to the working copy
--- a/tests/test-subrepo-git.t	Fri Jan 17 16:56:49 2020 -0500
+++ b/tests/test-subrepo-git.t	Tue Jan 21 13:14:51 2020 -0500
@@ -376,6 +376,15 @@
   a
   s/g
 
+  $ hg -R ../tc archive -S ../lf_archive.tgz --prefix '.' \
+  >       --config extensions.largefiles= 2>/dev/null
+  $ tar -tzf ../lf_archive.tgz | sort | grep -v pax_global_header
+  .hg_archival.txt
+  .hgsub
+  .hgsubstate
+  a
+  s/g
+
 create nested repo
 
   $ cd ..