I'm tearing my hair out here...
I've told TortoiseHg to create a repo of a directory that contains a mix of text files (mostly XML) and binary files.
I've done an initial commit, adding all files and ignoring .hgignore. Done.
Then I edited one of the XML files and saved.
The file indeed changed; I can see that the Initial Commit version has not the added line, while the version on the disk has the added line.
But for unknown reasons, Hg Workbench won't show the changed file!
I've tried pressing the 'refresh' buttons, all to no avail.
What is going on here? Is there a setting I've overlooked that caused TortoiseHg to ignore all files?
FYI, the .hgignore file only contains the following:
syntax: glob
.hgignore
I'm using TortoiseHg v3.0.1.
Total folder size is 280,240,487 bytes (lots of binary resources).
Thanks for any help!
EDIT: I still don't know what had gone wrong... but I accidentally fixed it:
I opened the XML file again, and serendipitously saw that I actually made a typo.
I fixed the typo, and re-saved the file.
All of a sudden, Hg Workshop saw the change!
Commit before Hg Workshop changed its mind.
Thanks for trying to help me... at the moment, I'm content that the 'invisible change' is fixed.
(Although I'm still wondering what had caused it in the first place.)
Related
I've been having some problems with mercurial and kiln, maybe you can point me in the right direction. Sometimes when I commit the files they get renamed as Upper Case 'Assembly.NameSpace' will be changed to 'ASSEMBLY.NAMESPACE' and if I try to commit after making changes to them they appear as not being tracked (Side note I found out about the renamed files after I committed).
No matter what I do they just wont be tracked. I tried add using the console, using hg workbench and nothing seems to work. For it to work I need to forget the files, then commit, then add them again and then commit, which it really sucks for me.
Is it possible the files already exist in the repository with different case? "Case Folding" is a problem for any system that needs to work on both systems that are truly case sensitive and those that are only case retentive. Mercurial has done a lot of work to degrade as well as possible when a case folding problem arises and there's a lot of detail about it in the Mercurial wiki.
On what OS are you working?
When you do that initial add of the files are you using a wildcard or specifying them by name?
Do the files on disk actually change case when you add them? Mercurial only alters files in the working director (the stuff outside of .hg) on update, so it seem pretty much impossible that just doing hg add; hg commit would change the case of a file in the working directory.
Upgrading to latest version will fix the problem.
I'm using TortoiseHG to commit code into a repository. Part of the system is symbolic links and these are throwing errors and are not allowing code to be committed. These directories do not need to be committed, so is there a way I can just ignore the directories?
If you have untracked content in your working folder, and want to keep them as untracked, there's generally three ways to do that:
Never issue any of the "please figure out what needs to be added and removed for me" commands (hg addremove and hg commit ... --addremove are examples of this)
Specifically list the files that you want to avoid being added, every time you issue such a command
List them in your .hgignore file
If you want to go with option 3, then you should consult the documentation for .hgignore. In general, you can just list the names of the files in that file, it's just a normal text file, but there's a few options regarding syntax for that, so best to just check the documentation.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Mercurial: How to ignore changes to a tracked file
I have a file in a Mercurial repository that I want to have stand as an example configuration file, but while I'm developing it I want to make specific changes to it I don't want tracked, like a database password. I tried adding that file to .hgignore, but Mercurial still notices modifications.
Can I have a file "tracked" in a Mercurial repository, yet ignore future local changes to that file without removing it from the repository itself?
I don't think this capability exists (love to see someone else's answer with an option though :) ). The alternative I've used is to check a file into source control named "config.template" (as an example). The app actually uses a file named "config", which I then create by copying the template file. Then make sure that the "config" file is excluded in the .hgignore file so you don't accidentally check in sometime.
No, there is no support built into Mercurial to automatically handle this, well... not in the way you're asking about.
There's two states of a file:
Tracked
Untracked
The only thing the .hgignore file does is to help with all the commands that just looks at all the untracked files and add them to the repository (ie. add them for tracking.) Once a file is being tracked, it will always be tracked.
The rest is left to manual handling, which means that if you track a file, but don't want to commit changes to it, you will have to uncheck, ignore, or otherwise make sure the commit command doesn't commit it, every time you commit.
The preferred way to handle this is instead to commit a template. Then, if possible, you add a step to your build process that checks if the actual configuration file is present, and if not, make a copy from the template. This actual configuration file you ensure is not tracked, and added to the .hgignore file.
This way, you can change the actual configuration file, but unless you specifically add it to the repository, it will not be tracked automatically, and there's nothing to do during commit.
You can just exclude the file in future commits.
This can be a bother if you use hg from the command line as you would have to specify manually which files you want to commit but if you use something like tortoisehg you can just uncheck the config file in the commit form and it's changes won't go in to the changeset.
I recently converted a CVS repository to Mercurial. From the looks of it, everything went perfect. Except that every end-of-line character is in Unix style and I want them in Windows style.
I know the hg convert command can be used to "convert" a Mercurial repository to a Mercurial repository. Can I use it to do nothing on the repos but fix the line endings?
How they're stored in the repo isn't terribly important since you do your actual work with the checked out working directory, whose line endings you can control at update time using either of these extensions:
Win32TextExtension
hg-eol extension
more detail is available here: https://www.mercurial-scm.org/wiki/EOLTranslationPlan
I don't think there's an easy way to get hg convert to do what you want (short of writing code that plugs into convert's code. Unfortunately, convert's hg-to-hg conversions are also not entirely clean, due to the generalized model convert has. This may not be a problem if you're coming from CVS, though.
One way is to use whatever tool that normalizes line endings and run it on every file in a checked out copy then commit every file. But that should be considered a last resort solution since it will make the history "dirty" (files will appear to have been changed when they practically have not been).
We are just beginning to learn and evaluate Mercurial, due to an increasing number of nightmare merges, and various other problems we've had with SVN lately.
A client wants us to pull down a live copy of their site, do some SEO work on it, and push it back to them. They have no source control at all. I figure this is a great project to work on with Mercurial. Instead of putting it into our SVN and exporting when we are done, we'll use Mercurial... But right away it seems I have some problem :)
They have a file called ---.config which seems to cause our Mercurial to barf. It just can't commit that file. I've created the repo and committed everything else, but I just can't get this one file committed.
We are running on Windows 2008 x64 with TortoiseHG 1.0.
I suppose I could ignore the file since it is unlikely we'll need to work with it, but still - I'd like to learn how to use Mercurial a bit better. Is there a way around this?
EDIT: here is the error message:
('commit', GetoptError('option ---.config not recognized', '-.config'))
This happens when I hit the "commit" button in TortoiseHG with that file selected.
Not sure about hg, but most command line tools treat anything after a -- as a non-option. This is helpful if you have a filename that starts with -- or a wildcard that picks up such a file; try prefixing your filename or wildcard with --, e.g., hg command -- *.config.
The problem is that TortoiseHg did not escape filenames correctly when calling hg. When a filename starts with --, one must take extra care when using it on command lines.
I have just sent a patch which will hopefully make it into TortoiseHg 1.0.1, which is scheduled to be released later today.