Patchwork D7650: match: normalize `cwd` early

login
register
mail settings
Submitter phabricator
Date Dec. 13, 2019, 7:51 p.m.
Message ID <differential-rev-PHID-DREV-emtffocekqkznotwtf44-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43804/
State Superseded
Headers show

Comments

phabricator - Dec. 13, 2019, 7:51 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  By having cwd in absolute form, we won't have to adjust it when
  passing it to subrepo matchers. This will matter for a coming patch.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/match.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - Dec. 20, 2019, 12:17 p.m.
pulkit added inline comments.

INLINE COMMENTS

> match.py:232
>      assert os.path.isabs(root)
> +    cwd = os.path.normpath(os.path.join(root, cwd))
>      normalize = _donormalize

`util.normpath` instead of `os.path.normpath`

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7650/new/

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

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Dec. 23, 2019, 8:30 p.m.
mharbison72 added a comment.


  This ends up making Windows unhappy.  I haven't had a chance to look into it yet.
  
  https://ci.hg.gregoryszorc.com/job-info/hg-committed-5685ce2ea3bfe2f82ba0119788e2fef853bcf97a-windows-cpython-2.7-x64-0#failed-tests

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7650/new/

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

To: martinvonz, #hg-reviewers, pulkit
Cc: mharbison72, pulkit, mercurial-devel
phabricator - Dec. 23, 2019, 8:34 p.m.
mharbison72 added a comment.


  In D7650#113661 <https://phab.mercurial-scm.org/D7650#113661>, @mharbison72 wrote:
  
  > This ends up making Windows unhappy.  I haven't had a chance to look into it yet.
  > https://ci.hg.gregoryszorc.com/job-info/hg-committed-5685ce2ea3bfe2f82ba0119788e2fef853bcf97a-windows-cpython-2.7-x64-0#failed-tests
  
  (The doctest failures are from D7649 <https://phab.mercurial-scm.org/D7649>.  The `../$TESTTMP` stuff is this one.)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7650/new/

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

To: martinvonz, #hg-reviewers, pulkit
Cc: mharbison72, pulkit, mercurial-devel

Patch

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -229,6 +229,7 @@ 
     False
     """
     assert os.path.isabs(root)
+    cwd = os.path.normpath(os.path.join(root, cwd))
     normalize = _donormalize
     if icasefs:
         dirstate = ctx.repo().dirstate