How to stop mercurial from syncing an EXISTING project file - mercurial

So the problem is that all developers need different settings for their local testing, but the settings file is part of the project (unlike the nbproject folder for example that we all ignore). I know about .htignore, but the filter only applies to files that are not part of the project.
If I forget the file, then this removes it from the "global" repository, where we have a "holder" version of the settings file.
Right now we just don't commit that file, but every now and then somebody forgets and pushes his own settings, which then are synced back to other developers and it's a constant pain. We just want to "automatically" not push that file. Is there a solution to this? Are we doing something wrong?

You could add a precommit hook that gives an error every time you try to commit this particular file.
To handle the case of developers that forget to setup such a hook, you can also add a serverside hook that will reject their push.

Related

Files not under caret on new computer

I opened my project on another computer, and the files where I'd been using a file watcher were expanded, like before they used to be nested like home.scss is now after I run the watcher once on that file.
Is there a way to automatically make all the files be nested?
Because when adding new files and folder with git, it would be quite troublesome to go into each and every file in order to make them become nested.
Like I have some minified JavaScript files that used to be nested, but now is expanded for some reason.
Hope you understand. Thank you.
Edit: Nested***
Is there a way to automatically make all the files go under a caret like that?
Unfortunately not. Such nesting information (to "go under a caret" as you are saying) is taken from "Output path to refresh" field of the corresponding File Watcher.
You have to run file watcher for such files at least once in order to see files nested like you have it on your another computer.
Here is how you can run File Watchers manually without the need to modify those files (so no extra history will appear in your git (or whatever VCS you may be using there)).
https://stackoverflow.com/a/20012655/783119
P.S.
In PhpStorm 2016.3 (the next version that will be released in 1.5-2 months or so) such nesting will be done automatically (the most common combinations) so there will be no need to have File Watchers for providing such info.
If you wish -- you can try EAP build right now (EAP means Early Access Program .. which is sort of Alpha/Beta builds (simply speaking).. and therefore some bugs for new functionality might be present and performance may not be optimal).

I cannot make my Morea repository private. How do I fix that?

When I try to make my Morea repository private, GitHub says that public forks cannot be made private. What do I do?
This was a bug in the original QuickStart instructions, which directed you to create a fork of the basic-template. They have now been fixed, but for those who have already set up a repo, please do the following:
(1) On your laptop, rename your morea directory (let's call it ics314f13/) to ics314f13-old/. Don't delete the directory, just rename it to something different.
(2) Go to GitHub, and delete your repository (i.e. ics314f13). You do this in the Settings page. While this appears scary, don't worry because you still have all your files in your local directory (i.e. ics314f13-old/). This step will mean that you've lost your commit history, but I assume that's not important. (If history is important, there are other more complicated ways to fix things, let me know.)
(2) Follow the revised QuickStart directions starting here:
http://morea-framework.github.io/quickstart.html#Createacourse
The new instructions direct you to create a new, empty GitHub repo. Use your original repo name, the one you just deleted (i.e. ics314f13).
You'll then download a new script (morea-vanilla-install.sh) and run it to initialize the contents of your empty repo with the contents of basic-template. The net effect is similar to a fork, but since you didn't actually fork, you'll be able to make your repo private if you want.
(3) Copy over the changed files from your "old" directory to your "new" directory.
You'll typically just copy over the file master/src/_config.yml and the entire directory master/src/morea/.
Advanced users like Cam might have created new navbar pages. He'll need to copy over these changes as well.
(4) Copy over scripts.
Copy over the morea-run-local.sh script from the "old" directory, and check to make sure everything looks OK.
Copy over the morea-publish.sh script from the "old" directory, and run it to push your changes to your new GitHub repo.
(5) Make your repo private.
You should now be able to go to the settings menu and make your repo private.

Mirgrating from mercurial Bfiles to largefiles

I have used mercurial's bfiles extension for some time and it works fine. The only problems are installation and the special "hg bfadd" command.
Now that Mercurial 2.0 include the largefile extension I would like to switch.
Can't find any tools or guides on how to do it? Anyone tried it yet.
I have several repositories that all use the same store and have the following mercurial.ini.
[bfiles]
store=\\Someserver\Mercurial\bFilesStore
autostatus = true
autoupdate = true
autorefresh = true
autoput = *
You can find the documentation here : https://www.mercurial-scm.org/wiki/LargefilesExtension
To enable the extension add the following to your hgrc :
[extensions]
largefiles =
You can add a new large file with :
hg add --large thisfileislarge
About the migration, the readme.txt of the bfiles extension says something about a migrate.txt file ( https://bitbucket.org/gward/hg-bfiles/overview section "The future"). But I can't find the file anywhere on the repository, maybe he forgot to upload it.
There's also a mail on mercurial-devel about this : https://www.mercurial-scm.org/pipermail/mercurial-devel/2011-October/035161.html but nothing since then.
Maybe the better solution is to contact the author of bfiles about his status on the migration process and keep using the old extension until you have an answer ?
Either way, there's a lot of bug report about largefiles since the release of 2.0, so it's maybe a good idea to wait anyway :)
In the latest hg-bfiles version (from 2011-12-05), if you update to the migrate branch, you get this help file:
bfiles: migrating to largefiles
If you want to migrate from bfiles to the new largefiles extension in
Mercurial 2.0, you first have to decide: convert your repo or keep it?
Converting your repo
This is appropriate if:
you have a small repository
you know exactly where every clone of it is
you can replace every clone
It involves creating an new repo with .hgbfiles/ replaced by .hglf/.
This means that your changeset IDs will differ, so you cannot
pull/push between the old and new repos. You must replace every
existing clone with a clone of the converted repo.
The advantage of converting your repo is that you can say goodbye
forever to bfiles, and move into the future using largefiles alone.
The process is mostly automated by two shell scripts: convert-repo and
convert-store.
Use the convert-repo shell script to convert the repository itself. This is just a wrapper around "hg convert" that takes care
of all the fussy details needed to turn .hgbfiles/ into .hglf/.
It's easy to run:
./convert-repo SRC-REPO DST-REPO
The resulting DST-REPO is not yet ready to use: you still have
to convert the bfiles store to a largefiles store.
Use convert-store to turn the bfiles store into a largefiles store. You must have a local copy of the bfiles store -- so you
probably want to run this on the server where your bfiles store
lives. Again, it's easy:
./convert-store SRC-STORE DST-REPO/.hg/largefiles
Putting the store inside your DST-REPO is the easiest way to
make largefiles just work.
Keeping your repo
(Yes, that's the end of the file, there's no help on how to keep your repository)

How do I change the template .hgignore used for new repositories?

When I create a new repository, I can ask TortoiseHG to give me a .hgignore file. Is there a way that I can customise what that file will look like, rather than having to go and get one manually from somewhere every time?
It's an old question, put still popped up as the first result on google, so here is an update:
In the TortoiseHg settings under the tab TortoiseHg users can specify the path of a Repo Skeleton. You can put your predefined .hgignore there, and it will be automatically copied during hg init.
See also:
#3569 Allow user-defined default .hgignore file when creating a new repository
TortoiseHG Docs
Like Tim already said in his comment, apparently it's not possible to do this.
Take a look at the following issue from TortoiseHG's bug tracker:
#966 Include some reasonable defaults in .hgignore on repo creation
Quotes from this link, both by Steve Borho (THG project lead):
This topic comes up on the Mercurial mailing list once a year or so and Matt always shoots it down. There is already support for user level ignore files; one could add these globs to a global file and be done with it.
and:
If a user has files or directories that they always want to ignore, they can add those to a global ignore file without having to introduce any new behaviors in THG.
So putting the things you always want ignored in a user-global ignore file seems to be the only option (even though it's not exactly what you're asking for):
Would like to create some defaults for my .hgignore files in TortoiseHG/Mercurial
(the question that I posted in my comment above)
Global hgignore usage

Mercurial replacing values in a file that been cloned?

Say I'm cloning a repository that I always clone to C:\working_copies\<customer-name>\<customer-project>\ and that the project has variables in it's build.properties that get filled in with <customer-name> <customer-project> (by me) everytime I clone the repo.
Is there a way that I can fill in these values in the file automatically by placing some special value in the file (in ant it's something like ${base-dir} or something like that) that would fill in these build.property values for me?
option 1: make sure build process only relies on relative paths, and dont change name/project variable
option2: write a hook, specifically a post-clone hook, try the book for a hook tutorial
No, Mercurial is completely unaware of what is outside of it's repository folder.
You should be able to rig this up using the Keyword Extension. Just set up a HGRC that populates the working directory with the values you want upon update.