temp directory.

Kevin Bullock kbullock+mercurial at ringworld.org
Wed Nov 17 16:13:01 CST 2010

On Nov 17, 2010, at 2:25 PM, Paolo Minazzi wrote:

>> If you want to avoid needless writes on the USB pen, I'd suggest doing
>> all your work on a separate clone on the hard disk, and push to the
>> pen drive after commit. Mercurial won't need a working copy inside the
>> pen drive repository, and it'll only write what's needed to record the
>> new revisions. And you'd get the additional benefit of an independent
>> separate copy of your project's whole history.
>> Regards,
>> Wagner
> Hi Wagner,
> thanks for your reply.
> Excuse me. My case is a little different.
> I have two PCs for developing.
> I want avoid to continue to copy/clone repository.
> My idea is to use only a USB pen, modify sources on it and do the build on harddisk.
> I have seen that if I use
>> mount -remount,ro /my_code (my_code is on the USB pen)
> "hg diff" does not work because it is a read-only filesystem.
> This means that "hg diff" try to write files on my USB pen.
> I want avoid this.

I don't think it's really possible to do this. Most likely `hg diff` is taking a lock on the repo, which requires it to be writeable. If you keep a working clone on the hard drive of each PC, you can work freely. You can also set up a commit hook to automatically push to the repo on the USB drive.

On the other hand, flash devices do a lot of work to optimize writes to extend the life of the device. Perhaps you can just trust your hardware to do the right thing :)

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock

> I'd like the mercurial had the possibility to set an environment variable to set temp directory.
> I have not found it.
> Maybe should I patch mercurial/util.py ? I don't know python ... :=(
> I use mercurial 0.9.4 on linux.
> Thanks,
> Paolo

More information about the Mercurial mailing list