Patchwork D6432: match: de-flake test-doctest.py by not depending on util.dirs() order

login
register
mail settings
Submitter phabricator
Date May 22, 2019, 11:41 p.m.
Message ID <4f83226968a8c001b08165db2a1b4c53@localhost.localdomain>
Download mbox | patch
Permalink /patch/40202/
State Not Applicable
Headers show

Comments

phabricator - May 22, 2019, 11:41 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc4b8f8637d7a: match: de-flake test-doctest.py by not depending on util.dirs() order (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6432?vs=15234&id=15241

REVISION DETAIL
  https://phab.mercurial-scm.org/D6432

AFFECTED FILES
  mercurial/match.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -614,7 +614,7 @@ 
         self._dirs = set(dirs)
         # parents are directories which are non-recursively included because
         # they are needed to get to items in _dirs or _roots.
-        self._parents = set(parents)
+        self._parents = parents
 
     def visitdir(self, dir):
         dir = normalizerootdir(dir, 'visitdir')
@@ -1384,26 +1384,26 @@ 
     >>> _rootsdirsandparents(
     ...     [(b'glob', b'g/h/*', b''), (b'glob', b'g/h', b''),
     ...      (b'glob', b'g*', b'')])
-    (['g/h', 'g/h', ''], [], ['', 'g'])
+    (['g/h', 'g/h', ''], [], set(['', 'g']))
     >>> _rootsdirsandparents(
     ...     [(b'rootfilesin', b'g/h', b''), (b'rootfilesin', b'', b'')])
-    ([], ['g/h', ''], ['', 'g'])
+    ([], ['g/h', ''], set(['', 'g']))
     >>> _rootsdirsandparents(
     ...     [(b'relpath', b'r', b''), (b'path', b'p/p', b''),
     ...      (b'path', b'', b'')])
-    (['r', 'p/p', ''], [], ['', 'p'])
+    (['r', 'p/p', ''], [], set(['', 'p']))
     >>> _rootsdirsandparents(
     ...     [(b'relglob', b'rg*', b''), (b're', b're/', b''),
     ...      (b'relre', b'rr', b'')])
-    (['', '', ''], [], [''])
+    (['', '', ''], [], set(['']))
     '''
     r, d = _patternrootsanddirs(kindpats)
 
-    p = []
-    # Append the parents as non-recursive/exact directories, since they must be
+    p = set()
+    # Add the parents as non-recursive/exact directories, since they must be
     # scanned to get to either the roots or the other exact directories.
-    p.extend(util.dirs(d))
-    p.extend(util.dirs(r))
+    p.update(util.dirs(d))
+    p.update(util.dirs(r))
 
     # FIXME: all uses of this function convert these to sets, do so before
     # returning.