Patchwork D8647: run-tests: replace '#' with '-' in temp path of repos created for tests

login
register
mail settings
Submitter phabricator
Date June 22, 2020, 9:36 a.m.
Message ID <differential-rev-PHID-DREV-6j24bfywz2jff3hzrh7a-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46544/
State New
Headers show

Comments

phabricator - June 22, 2020, 9:36 a.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  If we have multiple cases in a test, that leads us to a temp path of
  format "<temp-path>-<case1>#<case2>".
  This leads to  hg.parseurl() parsing the path and take part
  after `#` as a branch name.
  
  I encountered this bug while adding support for share-safe case in next patch.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1595,7 +1595,7 @@ 
             casepath = b'#'.join(case)
             self.name = '%s#%s' % (self.name, _bytes2sys(casepath))
             self.errpath = b'%s#%s.err' % (self.errpath[:-4], casepath)
-            self._tmpname += b'-%s' % casepath
+            self._tmpname += b'-%s' % casepath.replace(b'#', b'-')
         self._have = {}
 
     @property