changeset 47924:66ff8d3865b3

branching: merge stable into default
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 30 Aug 2021 12:25:57 +0200
parents c89ddef6474d (current diff) 86a60679cf61 (diff)
children ba9491be5e0c
files hgext/fix.py
diffstat 8 files changed, 68 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/heptapod-ci.yml	Fri Aug 27 09:09:10 2021 -0400
+++ b/contrib/heptapod-ci.yml	Mon Aug 30 12:25:57 2021 +0200
@@ -55,7 +55,6 @@
         PYTHON: python3
 
 phabricator-refresh:
-    <<: *all
     stage: phabricator
     variables:
       DEFAULT_COMMENT: ":white_check_mark: refresh by Heptapod after a successful CI run (:octopus: :green_heart:)"
--- a/contrib/install-windows-dependencies.ps1	Fri Aug 27 09:09:10 2021 -0400
+++ b/contrib/install-windows-dependencies.ps1	Mon Aug 30 12:25:57 2021 +0200
@@ -51,8 +51,8 @@
 $RUSTUP_INIT_URL = "https://static.rust-lang.org/rustup/archive/1.21.1/x86_64-pc-windows-gnu/rustup-init.exe"
 $RUSTUP_INIT_SHA256 = "d17df34ba974b9b19cf5c75883a95475aa22ddc364591d75d174090d55711c72"
 
-$PYOXIDIZER_URL = "https://github.com/indygreg/PyOxidizer/releases/download/pyoxidizer%2F0.16.0/PyOxidizer-0.16.0-x64.msi"
-$PYOXIDIZER_SHA256 = "2a9c58add9161c272c418d5e6dec13fbe648f624b5d26770190357e4d664f24e"
+$PYOXIDIZER_URL = "https://github.com/indygreg/PyOxidizer/releases/download/pyoxidizer%2F0.17/PyOxidizer-0.17.0-x64.msi"
+$PYOXIDIZER_SHA256 = "85c3bc21a18eb5e2db4dad87cca29accf725c7d59dd364a853ab5099c272024b"
 
 # Writing progress slows down downloads substantially. So disable it.
 $progressPreference = 'silentlyContinue'
--- a/contrib/packaging/hgpackaging/cli.py	Fri Aug 27 09:09:10 2021 -0400
+++ b/contrib/packaging/hgpackaging/cli.py	Mon Aug 30 12:25:57 2021 +0200
@@ -80,6 +80,7 @@
     if pyoxidizer_target:
         fn = wix.build_installer_pyoxidizer
         kwargs["target_triple"] = pyoxidizer_target
+        kwargs["extra_pyoxidizer_vars"] = extra_pyoxidizer_vars
     else:
         fn = wix.build_installer_py2exe
         kwargs["python_exe"] = pathlib.Path(python)
@@ -106,7 +107,7 @@
             "timestamp_url": sign_timestamp_url,
         }
 
-    fn(**kwargs, extra_pyoxidizer_vars=extra_pyoxidizer_vars)
+    fn(**kwargs)
 
 
 def get_parser():
--- a/contrib/packaging/hgpackaging/pyoxidizer.py	Fri Aug 27 09:09:10 2021 -0400
+++ b/contrib/packaging/hgpackaging/pyoxidizer.py	Mon Aug 30 12:25:57 2021 +0200
@@ -136,13 +136,8 @@
 
     run_pyoxidizer(source_dir, build_dir, target_triple)
 
-    if "windows" in target_triple:
-        target = "app_windows"
-    else:
-        target = "app_posix"
-
     build_dir = (
-        source_dir / "build" / "pyoxidizer" / target_triple / "release" / target
+        source_dir / "build" / "pyoxidizer" / target_triple / "release" / "app"
     )
 
     if out_dir.exists():
--- a/hg	Fri Aug 27 09:09:10 2021 -0400
+++ b/hg	Mon Aug 30 12:25:57 2021 +0200
@@ -28,14 +28,16 @@
 # to the documentation.
 if getattr(sys, 'frozen', None) == 'console_exe':
     vi = sys.version_info
-    sys.path.append(
-        os.path.join(
-            os.environ['APPDATA'],
-            'Python',
-            'Python%d%d' % (vi[0], vi[1]),
-            'site-packages',
+    appdata = os.environ.get('APPDATA')
+    if appdata:
+        sys.path.append(
+            os.path.join(
+                appdata,
+                'Python',
+                'Python%d%d' % (vi[0], vi[1]),
+                'site-packages',
+            )
         )
-    )
 
 from hgdemandimport import tracing
 
--- a/hgext/fix.py	Fri Aug 27 09:09:10 2021 -0400
+++ b/hgext/fix.py	Mon Aug 30 12:25:57 2021 +0200
@@ -752,8 +752,6 @@
 
     Directly updates the dirstate for the affected files.
     """
-    assert repo.dirstate.p2() == nullid
-
     for path, data in pycompat.iteritems(filedata):
         fctx = ctx[path]
         fctx.write(data, fctx.flags())
@@ -761,6 +759,7 @@
     oldp1 = repo.dirstate.p1()
     newp1 = replacements.get(oldp1, oldp1)
     if newp1 != oldp1:
+        assert repo.dirstate.p2() == nullid
         with repo.dirstate.parentchange():
             scmutil.movedirstate(repo, repo[newp1])
 
--- a/rust/hgcli/pyoxidizer.bzl	Fri Aug 27 09:09:10 2021 -0400
+++ b/rust/hgcli/pyoxidizer.bzl	Mon Aug 30 12:25:57 2021 +0200
@@ -47,14 +47,16 @@
 # Add user site to sys.path to load extensions without the full path
 if os.name == 'nt':
     vi = sys.version_info
-    sys.path.append(
-        os.path.join(
-            os.environ['APPDATA'],
-            'Python',
-            'Python%d%d' % (vi[0], vi[1]),
-            'site-packages',
+    appdata = os.environ.get('APPDATA')
+    if appdata:
+        sys.path.append(
+            os.path.join(
+                appdata,
+                'Python',
+                'Python%d%d' % (vi[0], vi[1]),
+                'site-packages',
+            )
         )
-    )
 import hgdemandimport;
 hgdemandimport.enable();
 from mercurial import dispatch;
@@ -253,7 +255,11 @@
         path = "defaultrc/editor.rc",
     )
 
-    wix = WiXInstaller("hg", "%s-%s.msi" % (MSI_NAME, VERSION))
+    wix = WiXInstaller(
+        "hg",
+        "%s-%s-%s.msi" % (MSI_NAME, VERSION, platform),
+        arch = platform,
+    )
 
     # Materialize files in the manifest to the install layout.
     wix.add_install_files(manifest)
--- a/tests/test-fix.t	Fri Aug 27 09:09:10 2021 -0400
+++ b/tests/test-fix.t	Mon Aug 30 12:25:57 2021 +0200
@@ -871,6 +871,45 @@
 
   $ cd ..
 
+We should be allowed to fix the working (and only the working copy) while
+merging.
+
+  $ hg init fixworkingcopywhilemerging
+  $ cd fixworkingcopywhilemerging
+
+  $ printf "a\nb\nc\n" > file.changed
+  $ hg commit -Aqm "ancestor"
+
+  $ printf "aa\nb\nc\n" > file.changed
+  $ hg commit -m "change a"
+
+  $ hg checkout '.^'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ printf "a\nb\ncc\n" > file.changed
+  $ hg commit -m "change c"
+  created new head
+
+  $ hg merge
+  merging file.changed
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ cat file.changed
+  aa
+  b
+  cc
+Not allowed to fix a parent of the working copy while merging
+  $ hg fix -r . --working-dir
+  abort: outstanding uncommitted merge
+  (use 'hg commit' or 'hg merge --abort')
+  [20]
+  $ hg fix --working-dir
+  $ cat file.changed
+  AA
+  b
+  CC
+
+  $ cd ..
+
 Abort fixing revisions if there is an unfinished operation. We don't want to
 make things worse by editing files or stripping/obsoleting things. Also abort
 fixing the working directory if there are unresolved merge conflicts.