diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -197,7 +197,7 @@ def issvnurl(ui, url): proto = 'file' path = os.path.abspath(url) if proto == 'file': - path = path.replace(os.sep, '/') + path = util.pconvert(path) check = protomap.get(proto, lambda *args: False) while '/' in path: if check(ui, path, proto): diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py +++ b/hgext/largefiles/lfutil.py @@ -303,7 +303,7 @@ def standin(filename): # 2) Join with '/' because that's what dirstate always uses, even on # Windows. Change existing separator to '/' first in case we are # passed filenames from an external source (like the command line). - return shortname + '/' + filename.replace(os.sep, '/') + return shortname + '/' + util.pconvert(filename) def isstandin(filename): '''Return true if filename is a big file standin. filename must be @@ -314,7 +314,7 @@ def splitstandin(filename): # Split on / because that's what dirstate always uses, even on Windows. # Change local separator to / first just in case we are passed filenames # from an external source (like the command line). - bits = filename.replace(os.sep, '/').split('/', 1) + bits = util.pconvert(filename).split('/', 1) if len(bits) == 2 and bits[0] == shortname: return bits[1] else: @@ -433,7 +433,7 @@ def httpsendfile(ui, filename): def unixpath(path): '''Return a version of path normalized for use with the lfdirstate.''' - return os.path.normpath(path).replace(os.sep, '/') + return util.pconvert(os.path.normpath(path)) def islfilesrepo(repo): return ('largefiles' in repo.requirements and diff --git a/mercurial/bdiff.c b/mercurial/bdiff.c --- a/mercurial/bdiff.c +++ b/mercurial/bdiff.c @@ -443,7 +443,7 @@ static PyObject *fixws(PyObject *self, P r = PyBytes_AsString(s); rlen = PyBytes_Size(s); - w = (char *)malloc(rlen); + w = (char *)malloc(rlen ? rlen : 1); if (!w) goto nomem; diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1224,8 +1224,8 @@ def forget(ui, repo, match, prefix, expl ui.status(_("skipping missing subrepository: %s\n") % join(subpath)) - for f in match.files(): - if match.exact(f) or not explicitonly: + if not explicitonly: + for f in match.files(): if f not in repo.dirstate and not os.path.isdir(match.rel(join(f))): if f not in forgot: if os.path.exists(match.rel(join(f))): diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -468,7 +468,7 @@ else: _HKEY_LOCAL_MACHINE) if not isinstance(value, str) or not value: return rcpath - value = value.replace('/', os.sep) + value = util.localpath(value) for p in value.split(os.pathsep): if p.lower().endswith('mercurial.ini'): rcpath.append(p) diff --git a/tests/test-check-code-hg.t b/tests/test-check-code-hg.t --- a/tests/test-check-code-hg.t +++ b/tests/test-check-code-hg.t @@ -1,9 +1,9 @@ $ check_code="$TESTDIR"/../contrib/check-code.py $ cd "$TESTDIR"/.. - $ "$check_code" `hg manifest` || echo 'FAILURE IS NOT AN OPTION!!!' + $ hg manifest | xargs "$check_code" || echo 'FAILURE IS NOT AN OPTION!!!' - $ "$check_code" --warnings --nolineno --per-file=0 `hg manifest` + $ hg manifest | xargs "$check_code" --warnings --nolineno --per-file=0 contrib/check-code.py:0: > # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', "don't use underbars in identifiers"), warning: line over 80 characters @@ -654,4 +654,4 @@ tests/test-walkrepo.py:0: > print "Found %d repositories when I should have found 3" % (len(reposet),) warning: line over 80 characters - [1] + [123] diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t --- a/tests/test-subrepo-recursion.t +++ b/tests/test-subrepo-recursion.t @@ -193,10 +193,14 @@ Test explicit path commands within subre $ hg add foo/bar/z2.txt $ hg status -S A foo/bar/z2.txt -This is expected to forget the file, but is currently broken $ hg forget foo/bar/z2.txt $ hg status -S ? foo/bar/z2.txt + $ hg forget foo/bar/z2.txt + not removing foo/bar/z2.txt: file is already untracked + [1] + $ hg status -S + ? foo/bar/z2.txt $ rm foo/bar/z2.txt Log with the relationships between repo and its subrepo: