Patchwork [1,of,2] git: pass a list to pathutil.dirs to indicate that it is a manifest

login
register
mail settings
Submitter Josef 'Jeff' Sipek
Date March 27, 2020, 2:48 p.m.
Message ID <4f4c2622ec748ce806c6.1585320537@meili>
Download mbox | patch
Permalink /patch/45923/
State Accepted
Headers show

Comments

Josef 'Jeff' Sipek - March 27, 2020, 2:48 p.m.
# HG changeset patch
# User Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
# Date 1585319920 14400
#      Fri Mar 27 10:38:40 2020 -0400
# Node ID 4f4c2622ec748ce806c6577c30d4f1ae8660a0c2
# Parent  5a77ab1704526629c316ebd93ca355d3439eb0b7
git: pass a list to pathutil.dirs to indicate that it is a manifest

The python implementation of pathutil.dirs just uses a for loop which
happens to work the same on both dicts and lists.  The rust implementation
actually figures out which of the two types it is, and directs the execution
to either dirstate or manifest processing.

Patch

diff --git a/hgext/git/manifest.py b/hgext/git/manifest.py
--- a/hgext/git/manifest.py
+++ b/hgext/git/manifest.py
@@ -232,7 +232,7 @@  class memgittreemanifestctx(object):
         # just narrow?
         assert not match or isinstance(match, matchmod.alwaysmatcher)
 
-        touched_dirs = pathutil.dirs(self._pending_changes)
+        touched_dirs = pathutil.dirs(list(self._pending_changes))
         trees = {
             b'': self._tree,
         }