This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to edit incorrect commit message in Mercurial?
Can i rename commit in mercurial before pushing on server from local repository?
I accidentally make commit with wrong name..(
Sounds to me like a duplicate of this question. Check that link, an answer is given there.
Importantly if you follow the advice on that page, make sure you backup your latest changeset. Performing a rollback will remove the latest changeset completely.
In fact, it may be wise to make a new clone of your working repository as a backup... just in case.
Related
Pretty much the title. I've looked at a lot of similar questions asked here, and I can't seem to find something that applies.
Started by syncing with HEAD. Created a few new files. Filled in those files, they were being tracked at this point. I then not only deleted the files, but also removed them from being tracked (because of stupid UI). According to my understanding, those files are gone for good, but I thought I'd check with people who are smarter than me: Is it possible to retrieve them?
Mercurial does not store uncommitted changes, so if you did not commit the files then they are lost.
If you did commit them, then hg update -C will restore them (and all other files --- make sure there are no other changes you haven't committed and want to keep) to the latest commit for your working dir.
I'm using TortoiseHg for working with a mercurial repository. I understand that it can be used for offline work which is why this doesn't happen automatically, but...
Q: Is there a way configure TortoiseHg to periodically pull changes or at least pull automatically when it is in use?
My machine is generally at work and the last thing I want to do is to start merging while not having the latest changes only to find that I need to resolve duplicate heads and re-do my work again.
Is there an existing way to tell TortoiseHg that it should keep in sync so that it doesn't fall too far out of sync? I'm not talking about updating my local respository in any way - I'm just talking about it doing a pull so that it knows the current state of the server's repository as closely as possible.
Please advise - and thanks!
Jeremy
I'm trying to make a crontab that pulls and makes a repository every day for me, but whenever i do that and the repository merges the crontab gets stuck.
Is there a way to pull without prompting a merge and without deleting my code?
Is there a way to pull without prompting a merge
Just hg pull by itself does not merge, nor does it ask the user for anything. The local repository will be added to, but the local working directory will not be touched. Nothing will be deleted.
If your .hgrc file is using a [defaults] section, you might be silently adding the -u/--update option without realizing it. That option tries to automatically do an update. If that's the case, then don't use defaults sections.
If this doesn't answer your question, then show us exactly what commands your cron entry is running, what the output is, where it "gets stuck" (is SSH asking for authentication credentials?), and which part you're trying to avoid.
The literal answer to how do you pull without merging is you hg fetch which gets the new remote changesets but doesn't update any files in your working directory. It sounds like what you're really asking though is "how do I update to tip and throw away any local changes?". If that's what you're going for you'd do:
hg fetch # gets new changesets
hg update --clean # update to latest files THROWING AWAY LOCAL CHANGES
Is that what you're going for?
I am (still) trying to completely migrate our company's SVN to HG.
For the most part I've succeeded, but we ran across a problem.
Our codebase has over 30 different projects, each one on its folder.
I've been asked multiple times how to commit and then push specific files to our central repository instead of being forced to commit everything everywhere to then push it, it's certainly annoying. Not being able to pull only specific projects is also an nuisance.
Is there any way to handle this like we used to in SVN? Where we could just commit what we wanted and not everything, and update only what was necessary.
Thank you.
A major difference between SVN and Mercurial is that you should have one repository per project in Mercurial.
You can change your repository to be multiple repositories using the convert extension.
Like Steve Kaye said you should create one repo per project, but as well you may want to create one master repo and include all your projects as subrepos This will allow svn like behavior of getting a copy of everything.
User A commited and pushed File A to the repo incrementing the version to 10. In the meantime, User B commited File B and started pushing out to the repo. User B got a message about 'pushing changes will create a new head, merge when possible'. User B did not know what to do at that time.
User B is me. What should I have done? I just freaked out and re-cloned the repo. My local copy was at version 9 at the time of my commit. So I wanted to update mine to 10 and then push mine out.
I am using Mercurial Hg.
Thanks.
You have to pull changes and merge them (In details you can read about it here: http://hginit.com/04.html)
Also - don't refer to revision number, it makes sense only for single repository. As long as you have several copies of the one - the better is to refer to the commit by its hash.