# HG changeset patch # User Matt Harbison # Date 1729045170 14400 # Node ID 93484d43be22e09ccf894a88e707406393bffad5 # Parent 3e7b9357bbb83338ff5d9f4bda1f3effed17d677 clonebundles: stop shell quoting `HGCB_BUNDLE_BASENAME` environment variable This causes problems in `test-clonebundles-autogen.t` on Windows, because the quoted path ends up being passed to the `cp` command, which fails, because quote characters are not a legal part of a file name. I don't see any quoting in environment variables on either MSYS or WSL, even with weird ones that appear to have escape sequences like `PS1=\[\033]0;$MSYSTEM:\w\007` (in MSYS). The quoting was added back in 5ae30ff79c76, and as shown here, was causing problems even on posix when a quote was slipped into the path. (The other obvious problem is that the command is spun up shell style, which invokes `cmd.exe`, which doesn't know about `$foo` style variables. That will be addressed next, but that change didn't work without this too.) diff -r 3e7b9357bbb8 -r 93484d43be22 hgext/clonebundles.py --- a/hgext/clonebundles.py Mon Oct 21 15:24:55 2024 -0400 +++ b/hgext/clonebundles.py Tue Oct 15 22:19:30 2024 -0400 @@ -786,9 +786,8 @@ else: cmd = repo.ui.config(b'clone-bundles', b'upload-command') url = repo.ui.config(b'clone-bundles', b'url-template') - filepath = procutil.shellquote(bundle.filepath) variables = { - b'HGCB_BUNDLE_PATH': filepath, + b'HGCB_BUNDLE_PATH': bundle.filepath, b'HGCB_BUNDLE_BASENAME': basename, } env = procutil.shellenviron(environ=variables) diff -r 3e7b9357bbb8 -r 93484d43be22 tests/test-clonebundles-autogen.t --- a/tests/test-clonebundles-autogen.t Mon Oct 21 15:24:55 2024 -0400 +++ b/tests/test-clonebundles-autogen.t Tue Oct 15 22:19:30 2024 -0400 @@ -76,8 +76,6 @@ adding manifests adding file changes 2 changesets found - cp: cannot stat ''\''$TESTTMP/embed-"-name/server/.hg/tmp-bundles/full-bzip2-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg'\''': $ENOENT$ (glob) - abort: command returned status 1: cp "$HGCB_BUNDLE_PATH" "$TESTTMP"/final-upload/ added 2 changesets with 2 changes to 2 files clone-bundles: starting bundle generation: bzip2-v2