files in .hg directory show up when I run "hg status" - mercurial

I am working on a project in Mercurial, and all of a sudden, when I run "hg status", I see a bunch of files in my ".hg" directory, reported as "not tracked". It looks like this:
? .hg/00changelog.i
? .hg/00manifest.i
? .hg/branch
? .hg/branchheads.cache
? .hg/data/.hgignore.i
? .hg/data/.htaccess.i
? .hg/data/autostart.cgi.i
? .hg/data/common.py.i
? .hg/data/common.pyc.i
? .hg/data/cron.i
? .hg/data/index.html.i
The list is much longer. I can show you everything if you want. Why is this happening? I know that files in ".hg" are special to Mercurial but why is it suddenly telling me now? It is annoying to have my status listing cluttered with this stuff. How can I make it stop?

Try cloning your repository and see if the problem persists in the new clone. If it doesn't you can copy over any uncommitted files to it and then adjust the default pull path in .hg/hgrc and forget about the broken clone. You may want to save the broken clone until you are sure everything you need is safely in the new clone.

Related

hg status returns blank but file has changed

I have a file that I've copied over the top of a file in my hg repo with xcopy. I've done this literally 1000's of times with different files and no issue. When I copy this specific file and try to commit, I get the 'nothing changed' message.
The file has definitely changed. If I open it in Notepad, make no changes and then resave it, mercurial recognizes the changes. If I open it in Notepad++, edit it, undo the edit and then save it, mercurial recognizes the changes.
If I restart the process (copying files into a new hg repo and committing), it fails at the same point every time. There is something about these files, but what? I thought it might be date modified as they were the exact same millisecond, but after editing my copied file to add 1 minute to the date modified, it still doesn't work.
What can cause this? What should I look for?
hg status
hg status -A
C file.txt
hg commit file.txt
nothing changed
On Windows, using Mercurial 2.2.2 with NO extensions enabled (inotify extension is known to cause a similar issue)
It appears that Mercurial (2.2.2 at least), only checks a file when it gets edited/replaced. It does this by checking the date modified. As my files had the exact same timestamp, it didn't check the contents.
When I edited the timestamp so it was different, that only changes the metadata and not the file itself. So Mercurial wasn't notified of the change, so it never looked and saw that the timestamp was different.
Solution: Changing the timestamp of the new file BEFORE copying the file (or copy it somewhere else, edit it, then copy to the repo) allows Mercurial to see the that the timestamp has changed and it will then check the contents for what's changed.

TortoiseHG is ignoring folder

I added CKEditor to my project. After final configuration, I am not able to commit folder dialog in folder ckeditor/plugins. When I open TortoiseHG Workbench, there is no dialog folder to commit. Other users after update didn't get that folder, so editor not work for others.
I am not ignoring that folder. Here is my .hgignore file:
syntax=regex
^\.
^target/
^jsTestDriver\.conf$
^node_modules/
^run-ft\.bat$
^run-ut\.bat$
log$
versionsBackup$
main\.css$
\.idea$
\.iml$
When I rename folder dialog to something else (for example dialog2), it automatically appears and I can commit, but dialog2 is useless for me. Please, any ideas?
Yes, it is normal, you have
log$
Which excludes the string if it ends with log, as in dialog...
If you need to exclude .log file, use
\.log$
Use hg add in console and add directory by hand (or move .hgignore temporary out of repository and add in GUI)
Try something like hg add -I ckeditor/plugins/dialog/* -n (and fix probably bad pattern for good result)

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)

telling mercurial to ignore a file when merging and updating

I want mercurial to ignore my own local copy of log/development.log (I am on RoR).
I used "hg forget filename" to forget the file, and then committed that change.
It seems to be successful now.. but every time I merge with other changesets now, I see
remote changed log/development.log which local deleted
use (c)hanged version or leave (d)eleted?
what am I doing wrong? how can I make this msg go away? I just want my local copy to be separate from the copy in the repository.
Thank you...
If you deleted the file in your line, and you merge it with the one that still has this file, this message is to be expected. The only way to get rid of it is to remove this file from the repos/branches you're merging with (or get their owners to remove it, if you don't control them).
And then never commit a temporary log file into the repository ever again.

In Mercurial, How to check the revision log of a specific folder?

So here is an example folder hierarchy:
c:\MyProject
c:\MyProject\Folder1
c:\Myproject\Folder2
In SVN, If I am only interested in looking at the history of changes in c:\MyProject\Folder1 I could just navigate to that folder, right click and view log.
With Mercurial doing the same thing shows all the changes in the entire MyProject. Is there a way to filter out and show me only changes in Folder1 (And its sub-folders) ?
It pretty much works as you would expect, same as for svn log:
hg log c:\MyProject\Folder1
In TortoiseHG, you right-click on Folder1 and open the Repository Explorer from there.
This automatically sets the filter in the Repository Explorer to show only the history of this folder.
Something similar is described here (for single files instead of folders, but you get the idea...)
In the new style tortoise hg (Hg Workbench) you can achieve this by right clicking and selecting TortoiseHg => Revision History on a folder in your repo.
What this actually does is filter (ctrl+s) like this file('path:some/relative/path')
Old question, but: if you installed only TortoiseHg with no explorer extensions, then you can press Ctrl-S in it and enter the revision query file("path:SOME/PATH").