Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am new to mercurial, and for the most part do LaTeX reports and statistical calculations in R using .csv and/or .sqlite files. Re LaTeX, all I really care is the .tex file. Re R, I don't need version control on the .csv or .sqlite files because they are static.

When I do 'hg add' for a repo with a .csv and/or .sqlite file, I get a warning like:

rev2.sqlite: up to 3070 MB of RAM may be required to manage this file
(use 'hg revert rev2.sqlite' to cancel pending addition)

So I revert and subsequently use adds like hg add -X *.sqlite. I guess I really have two questions:

(1) Should I ignore these warnings? Because these large files are static, can I just add to the repo knowing that the diff files will always be empty and not worry about wasted resources?

(2) If I should keep excluding these files from the repo, is there away that I can fix this option? I.E., add to my .hgrc file something that always appends an option like -I *.tex -I *.R to my 'hg add' commands?

Thanks!

share|improve this question

3 Answers 3

up vote 6 down vote accepted

in ~/.hgrc:

[ui]
ignore = ~/.hgignore

in ~/.hgignore:

syntax: glob
*.tex
*.R

(You can also put a .hgignore file in each project; the above will do it globally. You can call the .hgignorefile referenced in .hgrc anything you want; within a project it should always be called .hgignore)

share|improve this answer
    
Thanks! This did the trick. Although I used *.csv *sqlite because I wanted to ignore those, not the tex and R files. –  Richard Herron Jan 10 '11 at 19:13

You can create an .hgignore file to always ignore some files, see this SO question. You can read the documentation on the Mercurial wiki page for .hgignore or the man page for more information.

You might want an .hgignore like this to ignore any .sqlite or .csv file:

\.sqlite$
\.csv
share|improve this answer
    
Thanks! I was looking for a global solution, but your answer gave me the big picture. I knew the answer was out there, I just didn't know the right search query. –  Richard Herron Jan 10 '11 at 19:14

If you don't want to have to copy your large sqlite files by hand to all the instances of your repo, you may want to use the Hg largefiles extension.

It will save the file independently and do a very crude (but resource-efficient) version control, based on checksum comparisons. Other non-Hg-supported extensions BigFiles and Snap are also available.

BigFiles requires you to specify an alternate repo for big files by hand, and Snap is only available for some versions of hg. This is true for largefiles, which is only available in hg version 2.0 and higher. If you are using several different versions, you may have to go with the Bfiles extension

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.