2 ms·
I put similar code in Emacs's vc-hg to get revision information straight form Mercurial's on-disk data structures instead of firing up an hg subprocess.
by quotemstr 9y ago
I put similar code in Emacs's vc-hg to get revision information straight form Mercurial's on-disk data structures instead of firing up an hg subprocess.
- faho 9y agoYou mean actually reading dirstate[0] or just the branch/bookmark files? We also do the latter, but dirstate format isn't easily readable just with shell builtins (lots of fixed-length fields with NUL-byte padding, also we don't even have a `stat` builtin and the external program isn't a thing on macOS AFAIK), so we still fire up `hg status` for that - but only after we decide that there is a hg repo. [0]:https://www.mercurial-scm.org/wiki/DirState https://www.mercurial-scm.org/wiki/DirState
- quotemstr 9y agoYes, the dirstate. https://github.com/emacs-mirror/emacs/commit/de76a167dc09dc695a5acebabb7ab354a6bf556e#diff-46ea49f18ef6202e9436a621b2f176da https://github.com/emacs-mirror/emacs/commit/de76a167dc09dc6...