Losing contents of .hg folder with TortoiseHg - mercurial

So I have been working fine, committing, pushing to BitBucket. I went in to add a couple of extensions, restarted THG and now my repo shows as if it was brand new like I never did anything. I looked at the .hg folder and there was nothing in there!
So I cloned the repo from BitBucket under another name, moved the contents of the .hg folder to the old repo and changed the name in hgrc folder. Come to start using it today and was getting an error in the status bar. I restarted THG and it was back to like I have done nothing.
Why is this happening? Really frustrating. I am new to Mercurial, but I don't believe I did anything to warrant this?

Related

Getting .hg not found with Mercurial repo

Just the other day I was having some problems with my XCode project so I deleted all of the files in my project directory, downloaded my latest commit from BitBucket, and copied all the files from that directory into my empty project directory. Yes I know this was pretty dumb, but now when I try to make a new commit I get: .hg not found. Is it possible to fix this or have I permanently screwed over my repo?
The whole mercurial repository usually remains in your working folder, right under the sub-folder .hg. I say usually, because by deleting your working folder, you also deleted your repo, so yes, it cannot be found anymore. Simply downloading your latest state does not bring it back.
Don't worry, since you had the whole repo in Bitbucket, you only need to reclone. Make a manual backup of your current changes before doing so, if you don't want to loose them.

Mercurial on server can't find hgrc

I've just installed mercurial onto my server for team central repo, i've cloned the repo onto my local machine all worked fine, i've made changes and committed them to my local repo, but when i push to central command i get "ssl required" error. After researching it seems i have to enter :
[web]
push_ssl=False
allow_push=*
into the hgrc file. I have looked in the repo directory under /.hg but there is no hgrc file in this folder i only have, branchheads.cache, dirstate, 00changelog.i, requires, tags,cace, undo.branch, undo.dirstate,
any help would be great so i can push the changes back to the server for other developers to pull down
Just create .hgrc file (note leading dot), if it doesn't exist

HG PUSH won't push to local directory. Repository not found

I am using Tortoise HG two handle source control for a couple of projects on my local machine. I am pushing to a local directory elsewhere on the HD, just as a way to handle revision history.
My directories are set up like so:
Projects are located here: like MyDocuments\Project1.
I push commits to here:
C:\Repository\Project1
C:\Repository\Project2
For one of these projects, this works. For the other, when I try and push, I get an error that it cannot find the directory. Security settings (Windows 7) are the same for both directories.
MyDocuments\Project2 was under this source control at one time, and then something got messed up. So, I deleted the .hg file and hg directory and started over, creating a new repository there and adding all the files for the initial commit. But the initial commit will not push. It says:
repository C:\Repository\Project2 not found
I'm at a loss. I've deleted the HG files and directory three times and started over, but I cannot push. I've tried pushing to a different directory - no luck. I am guessing something is glitched from trying to start over.
You shouldn't delete the .hg folder as that is what makes it a Mercurial repository.
I'd say that the solution would be to re-clone the MyDocuments\Project2 repository to C:\Repository\Project2 and start again from there.
In future, if you get to the position where you feel that you need to delete the .hg folder, don't. Come back here and see if we can do anything to help resolve the problem.

Repository is changed after push on mercurial

When I create repository and push on server and when we clone the repository in local system the files are come with red signal means they are changed.
When we compare both repository I found that the content of files in .hg folder is changed.
Can anyone pls tell me how to remove this problem!
Edit:
When we change the .hg folder the red icon becomes green!!!!
If you take 1 modified (changed) file, watch the diff closely, and only see the difference is in new lines only, this is the classical newlines mess.
(happens to most people when working crossplatform)
There is a ready to use Mercurial Extension, taking care of this is problem.
It's called eol.
Learn how to use it and the problem from here:
https://www.mercurial-scm.org/wiki/EolExtension
how do you push localy created repository to server? If there is no repo with same name(on server), you could not be able to create remote repo by push, you have to clone it to the server. Or, if there already is repository with same name, and you push some new localy created, there definitely will be something more in .hg on the server then on the local. Check if there isn't repo with same name on the server already. HTH

Moving the .hg folder

Hey, I'm using Mercurial. I just found out that there is a .hg folder in my home directory. I presume it is keeping track of all mercurial repositories I have lying around in my home directory. Is this true?
Also , I need to move the .hg folder to another directory. Can anyone guide me as to how to do this?
Thanks
Having a .hg/ in your home directory indicates that your entire home directory is under version control, which probably is not what you want. Mercurial does not "keep track" of multiple repositories.
To move a repository somewhere else, use "hg clone".
no
cp src dst, or better hg clone
In contrast to e.g. svn, mercurial keeps all repository related information under one directory, so you just need to move this directory to its destination.
Ps. It's a little unusual to have a repository (.hg) under home, though. More typically, you'll find a .hgrc under home, which contains some mercurial configuration.
More on mercurial usage and internals: http://hgbook.red-bean.com

Categories