Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Record extension for Mercurial

📅 2015-Mar-03 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ extension, mercurial, record ⬩ 📚 Archive

Record is an important extension for Mercurial and it ships along with it. It provides the record command, using which you can pick and choose which changes and modified files you want to commit. It feeds you the changes and modified files in an interactive format, so you do not have to type out long paths or other specifications.

You can specify which of the modified files you want to commit to the commit command, but typing out the file paths like that is cumbersome. Also, it does not allow you to pick and choose changes inside a file. I feel that the record command is better for this use case.

To enable the Record extension, add these lines to your hgrc:

record =

Using it is as simple as:

$ hg record

For each change or file it shows, you can provide one of these inputs:

y - record this change
n - skip this change

s - skip remaining changes to this file
f - record remaining changes to this file

d - done, skip remaining changes and files
a - record all changes to all remaining files
q - quit, recording no changes

? - display help

Tried with: Mercurial 2.8.2 and Ubuntu 14.04

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧