temp directory.

Adrian Buehlmann adrian at cadifra.com
Wed Nov 17 17:00:19 CST 2010


On 2010-11-17 23:13, Kevin Bullock wrote:
> 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.

(What Matt said)

No. It shouldn't take a lock for hg diff.

A write might only be caused by creating cache files. Inserting a
debug print statement in the util.opener code path for write modes
reveals (I did this on a write enabled volume):

$ hg diff -r 819d6fc56760:3
opener(C:\Users\adi\hgrepos\tests\a\.hg) wb C:\Users\adi\hgrepos\tests\a\.hg\tags.cache
opener(C:\Users\adi\hgrepos\tests\a\.hg) wb C:\Users\adi\hgrepos\tests\a\.hg\branchheads.cache
diff --git a/a.txt b/a.txt
--- a/a.txt
+++ b/a.txt
@@ -1,4 +1,3 @@
 bla
 sfaasf
-qqq
-sss
+qqq

tags.cache and branchheads.cache are created when mercurial needs to
do a lookup by revision id (e.g. 819d6fc56760), tag or branch name.

And these files are only created/updated if they are missing/out of
date.



More information about the Mercurial mailing list