diff hgext/narrow/narrowcommands.py @ 51276:03665fd8ccb9

narrow: strip trailing `/` from manifest dir before matching it Commit 17a822d7943e broke some of our internal tests at Google because the `dir` variable contains a trailing slash since that commit. Let's restore the old behavior by stripping that trailing slash.
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 16 Dec 2023 10:48:20 -0800
parents 75b90a8eb168
children f4733654f144
line wrap: on
line diff
--- a/hgext/narrow/narrowcommands.py	Mon Dec 18 10:13:41 2023 -0800
+++ b/hgext/narrow/narrowcommands.py	Sat Dec 16 10:48:20 2023 -0800
@@ -296,7 +296,7 @@
                     for file_ in entry.files():
                         todelete.append(file_.unencoded_path)
             elif entry.is_manifestlog:
-                dir = entry.target_id
+                dir = entry.target_id[:-1]
                 dirs = sorted(pathutil.dirs({dir})) + [dir]
                 include = True
                 for d in dirs: