merge with stable
authorAugie Fackler <augie@google.com>
Mon, 15 Jun 2020 12:00:15 -0400
changeset 44960 78cafd48b9b2
parent 44953 50005af3c7a8 (current diff)
parent 44959 170f8a43b5b8 (diff)
child 44961 ee5f27d7b9fb
merge with stable
hgext/rebase.py
mercurial/utils/procutil.py
rust/Cargo.lock
tests/test-check-pyflakes.t
tests/test-persistent-nodemap.t
--- a/.hgsigs	Fri Jun 12 23:43:56 2020 +0200
+++ b/.hgsigs	Mon Jun 15 12:00:15 2020 -0400
@@ -196,3 +196,4 @@
 8fca7e8449a847e3cf1054f2c07b51237699fad3 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl6GDVQQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91egzEACNEyQwLWCQEeNyxXKuTsnXhYU/au7nSGOti/9+zg/22SSceMsVcIyNr2ZnkMf3hnzBjL7Efsthif0QXyfB0LZDXwNuDmNlDtUV2veyVGSDE2UqiSbDBRu6MYTvtfYX87RmSWla3HHO09pwpcrhxyHs3mliQsXyB2+D+ovTOIjYukQLnh34jQnwiWEYLDXkHEHHTpdXqAnA7tVen3ardLyTWgky6DUwlfcnoVsAPXnDkqQ9aE2w7SoAsNtEAddmkjKoYYdBkV5aUInU/DyFVF7qnlCcvWm+EkN1708xZUQ1KzdAyeeoIrMkBgpSoyeNQ9pcU3T7B100UxLo/FP/A7y96b2kHnKJU6fVyD3OeHvP9SeucurC6jn2YoG3e1wSOQcbEuCsdGjqgAHnKt2SMPsEBu2qJJcUdco9tANN5BdntBo7bLc/zcpXZH3TkRfRSndWXPaXDJaQNvbH7aLIUTCP9oQaqTN+9BQ+Egt7YsB4C58JZmC87FAuekDULc4LWK2gDPFf7F/PvBnMh7+YylPl/8LLrEnz2Q/GM0S1HLhBrDf6vzxV5wVzCu9Q2N0PCkg6lDAJFVWLTEbxcRukKxbyK88Yzrb4GuUY4F5V21fN4vuxkOay7eoiXUcHMN2IN+DwhNWQSm5pUnpqGTfC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R3S/G3p8QkyWYL3CZNKjCAVxSa5ytS5Dr/bM2sWaEnIHqq+W6DOagpWV4uRRnwaId9tB9b0KBoFElXZRlaq0FlNYG8RLg65ZlkF+lj6RACO23epxapadcJwibDQiNYX20mcSEFDkSEgECnLQBecA2WZvw134RRbL3vuvB49SKS0ZEJ95myXMZa9kyIJY/g+oAFBuyZeK9O8DwGii0zFDOi6VWDTZzc3/15RRS6ehqQyYrLQntYtVGwHpxnUrp2kBjk3hDIvaYOcFbTnhTGcQCzckFnIZN2oxr5YZOI+Fpfak6RQTVhnHh0/
--- a/.hgtags	Fri Jun 12 23:43:56 2020 +0200
+++ b/.hgtags	Mon Jun 15 12:00:15 2020 -0400
@@ -209,3 +209,4 @@
 8fca7e8449a847e3cf1054f2c07b51237699fad3 5.3.2
 26ce8e7515036d3431a03aaeb7bc72dd96cb1112 5.4rc0
 cf3e07d7648a4371ce584d15dd692e7a6845792f 5.4
+065704cbdbdbb05dcd6bb814eb9bbdd982211b28 5.4.1
--- a/hgext/rebase.py	Fri Jun 12 23:43:56 2020 +0200
+++ b/hgext/rebase.py	Mon Jun 15 12:00:15 2020 -0400
@@ -368,7 +368,9 @@
         skippedset.update(obsoleteextinctsuccessors)
         _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
 
-    def _prepareabortorcontinue(self, isabort, backup=True, suppwarns=False):
+    def _prepareabortorcontinue(
+        self, isabort, backup=True, suppwarns=False, dryrun=False, confirm=False
+    ):
         self.resume = True
         try:
             self.restorestatus()
@@ -391,7 +393,12 @@
 
         if isabort:
             backup = backup and self.backupf
-            return self._abort(backup=backup, suppwarns=suppwarns)
+            return self._abort(
+                backup=backup,
+                suppwarns=suppwarns,
+                dryrun=dryrun,
+                confirm=confirm,
+            )
 
     def _preparenewrebase(self, destmap):
         if not destmap:
@@ -750,7 +757,7 @@
         ):
             bookmarks.activate(repo, self.activebookmark)
 
-    def _abort(self, backup=True, suppwarns=False):
+    def _abort(self, backup=True, suppwarns=False, dryrun=False, confirm=False):
         '''Restore the repository to its original state.'''
 
         repo = self.repo
@@ -794,7 +801,10 @@
 
                 updateifonnodes = set(rebased)
                 updateifonnodes.update(self.destmap.values())
-                updateifonnodes.add(self.originalwd)
+
+                if not dryrun and not confirm:
+                    updateifonnodes.add(self.originalwd)
+
                 shouldupdate = repo[b'.'].rev() in updateifonnodes
 
                 # Update away from the rebase if necessary
@@ -1120,7 +1130,10 @@
                     rbsrt._finishrebase()
                 else:
                     rbsrt._prepareabortorcontinue(
-                        isabort=True, backup=False, suppwarns=True
+                        isabort=True,
+                        backup=False,
+                        suppwarns=True,
+                        confirm=confirm,
                     )
                 needsabort = False
             else:
@@ -1135,7 +1148,10 @@
             if needsabort:
                 # no need to store backup in case of dryrun
                 rbsrt._prepareabortorcontinue(
-                    isabort=True, backup=False, suppwarns=True
+                    isabort=True,
+                    backup=False,
+                    suppwarns=True,
+                    dryrun=opts.get(b'dry_run'),
                 )
 
 
--- a/hgext/zeroconf/Zeroconf.py	Fri Jun 12 23:43:56 2020 +0200
+++ b/hgext/zeroconf/Zeroconf.py	Mon Jun 15 12:00:15 2020 -0400
@@ -1647,7 +1647,7 @@
                     and record.alias == info.name
                 ):
                     if info.name.find(b'.') < 0:
-                        info.name = b"%w.[%s:%d].%s" % (
+                        info.name = b"%s.[%s:%d].%s" % (
                             info.name,
                             info.address,
                             info.port,
--- a/mercurial/helptext/hgignore.txt	Fri Jun 12 23:43:56 2020 +0200
+++ b/mercurial/helptext/hgignore.txt	Mon Jun 15 12:00:15 2020 -0400
@@ -95,3 +95,9 @@
   # switch to regexp syntax.
   syntax: regexp
   ^\.pc/
+
+Debugging
+=========
+
+Use the ``debugignore`` command to see if and why a file is ignored, or to
+see the combined ignore pattern. See :hg:`help debugignore` for details.
--- a/mercurial/pycompat.py	Fri Jun 12 23:43:56 2020 +0200
+++ b/mercurial/pycompat.py	Mon Jun 15 12:00:15 2020 -0400
@@ -143,6 +143,11 @@
 
     long = int
 
+    # Warning: sys.stdout.buffer and sys.stderr.buffer do not necessarily have
+    # the same buffering behavior as sys.stdout and sys.stderr. The interpreter
+    # initializes them with block-buffered streams or unbuffered streams (when
+    # the -u option or the PYTHONUNBUFFERED environment variable is set), never
+    # with a line-buffered stream.
     # TODO: .buffer might not exist if std streams were replaced; we'll need
     # a silly wrapper to make a bytes stream backed by a unicode one.
     stdin = sys.stdin.buffer
--- a/mercurial/revlog.py	Fri Jun 12 23:43:56 2020 +0200
+++ b/mercurial/revlog.py	Mon Jun 15 12:00:15 2020 -0400
@@ -651,7 +651,10 @@
                 nodemap_data = nodemaputil.persisted_data(self)
                 if nodemap_data is not None:
                     docket = nodemap_data[0]
-                    if d[0][docket.tip_rev][7] == docket.tip_node:
+                    if (
+                        len(d[0]) > docket.tip_rev
+                        and d[0][docket.tip_rev][7] == docket.tip_node
+                    ):
                         # no changelog tampering
                         self._nodemap_docket = docket
                         index.update_nodemap_data(*nodemap_data)
--- a/mercurial/utils/resourceutil.py	Fri Jun 12 23:43:56 2020 +0200
+++ b/mercurial/utils/resourceutil.py	Mon Jun 15 12:00:15 2020 -0400
@@ -23,10 +23,10 @@
     (portable, not much used).
     """
     return (
-        pycompat.safehasattr(sys, "frozen")
-        or pycompat.safehasattr(sys, "importers")  # new py2exe
-        or imp.is_frozen("__main__")  # old py2exe
-    )  # tools/freeze
+        pycompat.safehasattr(sys, "frozen")  # new py2exe
+        or pycompat.safehasattr(sys, "importers")  # old py2exe
+        or imp.is_frozen("__main__")  # tools/freeze
+    )
 
 
 # the location of data files matching the source code
--- a/rust/Cargo.lock	Fri Jun 12 23:43:56 2020 +0200
+++ b/rust/Cargo.lock	Mon Jun 15 12:00:15 2020 -0400
@@ -210,7 +210,7 @@
  "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "micro-timer 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "micro-timer 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_distr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -280,16 +280,16 @@
 
 [[package]]
 name = "micro-timer"
-version = "0.2.1"
+version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "micro-timer-macros 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "micro-timer-macros 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "micro-timer-macros"
-version = "0.2.0"
+version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -672,8 +672,8 @@
 "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
 "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
 "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9"
-"checksum micro-timer 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "987429cd6162a80ed5ff44fc790f5090b1c6d617ac73a2e272965ed91201d79b"
-"checksum micro-timer-macros 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "43cec5c0b38783eb33ef7bccf4b250b7a085703e11f5f2238fa31969e629388a"
+"checksum micro-timer 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "25b31d6cb9112984323d05d7a353f272ae5d7a307074f9ab9b25c00121b8c947"
+"checksum micro-timer-macros 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5694085dd384bb9e824207facc040c248d9df653f55e28c3ad0686958b448504"
 "checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba"
 "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
 "checksum num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6"
--- a/tests/test-bundle2-format.t	Fri Jun 12 23:43:56 2020 +0200
+++ b/tests/test-bundle2-format.t	Mon Jun 15 12:00:15 2020 -0400
@@ -148,7 +148,7 @@
   >        bundler.newpart(b'output', data=genraise(), mandatory=False)
   > 
   >     if path is None:
-  >        file = pycompat.stdout
+  >         file = pycompat.stdout
   >     else:
   >         file = open(path, 'wb')
   > 
--- a/tests/test-persistent-nodemap.t	Fri Jun 12 23:43:56 2020 +0200
+++ b/tests/test-persistent-nodemap.t	Mon Jun 15 12:00:15 2020 -0400
@@ -436,10 +436,32 @@
   data-unused: 0.369% (rust !)
   data-unused: 0.000% (no-pure no-rust !)
   $ f --size --sha256 .hg/store/00changelog-*.nd
-  .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
-  .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
+  .hg/store/00changelog-????????????????.nd: size=123584, sha256=8c6cef6fd3d3fac291968793ee19a4be6d0b8375e9508bd5c7d4a8879e8df180 (glob) (pure !)
+  .hg/store/00changelog-????????????????.nd: size=123584, sha256=eb9e9a4bcafdb5e1344bc8a0cbb3288b2106413b8efae6265fb8a7973d7e97f9 (glob) (rust !)
   .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
 
+Check that removing content does not confuse the nodemap
+--------------------------------------------------------
+
+removing data with rollback
+
+  $ echo aso > a
+  $ hg ci -m a4
+  $ hg rollback
+  repository tip rolled back to revision 5005 (undo commit)
+  working directory now based on revision 5005
+  $ hg id -r .
+  90d5d3ba2fc4 tip
+
+roming data with strip
+
+  $ echo aso > a
+  $ hg ci -m a4
+  $ hg --config extensions.strip= strip -r . --no-backup
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg id -r . --traceback
+  90d5d3ba2fc4 tip
+
 Test upgrade / downgrade
 ========================
 
--- a/tests/test-rebase-named-branches.t	Fri Jun 12 23:43:56 2020 +0200
+++ b/tests/test-rebase-named-branches.t	Mon Jun 15 12:00:15 2020 -0400
@@ -293,6 +293,139 @@
   rebasing 9:e522577ccdbd "D"
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/8e279d293175-b023e27c-rebase.hg
 
+  $ hg log -G -Tcompact
+  o  11[tip]   be1dea60f2a6   2011-04-30 15:24 +0200   nicdumz
+  |    D
+  |
+  o  10   ac34ce92632a   2011-04-30 15:24 +0200   nicdumz
+  |    C
+  |
+  o  9   7bd665b6ce12   2011-04-30 15:24 +0200   nicdumz
+  |    B
+  |
+  o  8   58e7c36e77f7   1970-01-01 00:00 +0000   test
+  |    dev-two named branch
+  |
+  o  7   8e5a320651f3   2011-04-30 15:24 +0200   nicdumz
+  |    H
+  |
+  @  6   2b586e70108d   1970-01-01 00:00 +0000   test
+  |    close b
+  |
+  o  5:3   3f9d5df8a707   1970-01-01 00:00 +0000   test
+  |    create b
+  |
+  | o  4:3,1   aeefee77ab01   2011-04-30 15:24 +0200   nicdumz
+  |/|    G
+  | |
+  o |  3   e908b85f3729   2011-04-30 15:24 +0200   nicdumz
+  | |    F
+  | |
+  o |  2:0   bc8139ee757c   1970-01-01 00:00 +0000   test
+  | |    dev-one named branch
+  | |
+  | o  1   9520eea781bc   2011-04-30 15:24 +0200   nicdumz
+  |/     E
+  |
+  o  0   cd010b8cd998   2011-04-30 15:24 +0200   nicdumz
+       A
+  
+  $ echo A-mod > A
+  $ hg diff
+  diff -r 2b586e70108d A
+  --- a/A	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/A	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -A
+  +A-mod
+
+--dry-run doesn't affect a dirty working directory that is unrelated to the
+source or destination.
+
+  $ hg rebase -s tip -d 4 --dry-run
+  starting dry-run rebase; repository will not be changed
+  rebasing 11:be1dea60f2a6 "D" (tip)
+  dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
+  $ hg diff
+  diff -r 2b586e70108d A
+  --- a/A	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/A	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -A
+  +A-mod
+
+Bailing out on --confirm doesn't affect a dirty working directory that is
+unrelated to the source or destination.
+
+  $ echo A-mod > A
+  $ echo n | hg rebase -s tip -d 4 --confirm --config ui.interactive=True
+  starting in-memory rebase
+  rebasing 11:be1dea60f2a6 "D" (tip)
+  rebase completed successfully
+  apply changes (yn)? n
+  $ hg diff
+  diff -r 2b586e70108d A
+  --- a/A	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/A	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -A
+  +A-mod
+
+  $ echo A-mod > A
+  $ hg rebase -s tip -d 4 --confirm
+  starting in-memory rebase
+  rebasing 11:be1dea60f2a6 "D" (tip)
+  rebase completed successfully
+  apply changes (yn)? y
+  saved backup bundle to $TESTTMP/a1/.hg/strip-backup/be1dea60f2a6-ca6d2dac-rebase.hg
+  $ hg diff
+  diff -r 2b586e70108d A
+  --- a/A	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/A	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -A
+  +A-mod
+
+Attempting to rebase the parent of a dirty working directory will abort, without
+mangling the working directory...
+
+  $ hg rebase -s 5 -d 4 --dry-run
+  starting dry-run rebase; repository will not be changed
+  abort: uncommitted changes
+  [255]
+  $ hg diff
+  diff -r 2b586e70108d A
+  --- a/A	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/A	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -A
+  +A-mod
+
+... ditto for --confirm
+
+  $ echo n | hg rebase -s 5 -d 4 --confirm --config ui.interactive=True
+  starting in-memory rebase
+  abort: uncommitted changes
+  [255]
+  $ hg diff
+  diff -r 2b586e70108d A
+  --- a/A	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/A	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -A
+  +A-mod
+  $ hg rebase -s 5 -d 4 --confirm
+  starting in-memory rebase
+  abort: uncommitted changes
+  [255]
+  $ hg diff
+  diff -r 2b586e70108d A
+  --- a/A	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/A	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -A
+  +A-mod
+
   $ cd ..
 
 Rebase to other head on branch