The solution for Mercurial is an extension called record.
You enable the extension in your hgrc file. You would properly want to do it in the ~/.hgrc file to make it system wide.
Then you just write:
You might also consider these other extensions:
bfiles = ~/path_to_bfiles