D2057: rust implementation of hg status
yuja (Yuya Nishihara)
phabricator at mercurial-scm.org
Thu Mar 22 11:00:17 EDT 2018
yuja added a comment.
In https://phab.mercurial-scm.org/D2057#46980, @Ivzhh wrote:
> In https://phab.mercurial-scm.org/D2057#46726, @yuja wrote:
>
> > >> I think the only place where you would need to do os-specific code is when
> > >> doing serialization and serialization
> > >
> > > Yes, that will be feasible in strictly typed language like Rust.
> >
> > To be clear, I meant serialization/deserialization between filesystem path and
> > internal dirstate/manifest path, not between dirstate storage and in-memory
> > dirstate object.
>
>
> I guess your suggestion is like this: @yuja
>
> 1. if it is windows and the code page is MBCS, try to decode the paths read from manifest and dirstate into unicode equivalent
> 2. use utf internally and with rust IO api
> 3. when writing back to dirstate and manifest, encode utf to MBCS
No. My suggestion is:
1. keep manifest/dirstate paths as bytes (which are probably wrapped by some type, say HgPath)
2. but we want to use Rust's standard library for I/O
3. so, add utility function/trait to convert HgPath to Path/PathBuf, where MBCS-Wide conversion will occur.
I think raw byte paths will be needed to build store paths (e.g. `.hg/store/data/~2eclang-format.i`).
https://www.mercurial-scm.org/repo/hg/file/4.5.2/mercurial/store.py
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2057
To: Ivzhh, #hg-reviewers, kevincox
Cc: quark, yuja, glandium, krbullock, indygreg, durin42, kevincox, mercurial-devel
More information about the Mercurial-devel
mailing list