I have a weird situation here:
when I go on my hg server and do a
sudo hg archive /project/export
It archives it, but in the hidden .hg_archival.txt file I see
branch: default
latesttag: null
latesttagdistance: 31
But the latest checkin was 33. Which seems ignored.
Previously I had to remove changeset 32
hg clone <old repo> <new repo> -r 31
And added later two new checkins...
Could this be the reason for the hickup? What can I do?
Thanks,
You likely aren't updated to the tip. Run hg parent. hg archive will archive the current parent, so you are probably on local revision 31, not 33. After you cloned to 31 and pulled the new checkins, did you hg update?
Related
I have a mercurial repo with no uncommitted changes. I was on revision 846, and decided my last 2 commits were junk and wanted to carry on as if from revision 844. So I was going to type:
hg revert -r 844 --all
Unfortunately I mistyped, and wrote:
hg revert -r 44 --all
So my whole repository has changed dramatically, including directory structure. I don't see any .orig files, so I don't think the answer in:
How to undo a revert in mercurial
helps me.
hg log still has all of my commits up to revision 846 - do you think I can revert back to revision 846?
Advice very welcome
hg revert just sets your working copy to the revision that you specify so if you didn't do a commit after the revert then your repository has not changed. To fix it you can just do hg update -C and then delete all the .orig files.
After that you can do the correct revert statement to remove the last two revisions.
If you did do the commit then the command that you wanted to do (hg revert -r 844 --all) would still get you to the point that you want by undoing the revert commit as well as the two commits that you originally intended to undo.
I have a Windows file structure like so:
Stable
ProjectA
SharedLibrary
Stable contains the main repo. ProjectA and SharedLibrary are subrepos of Stable. The .hgsub file contains:
ProjectA = ProjectA
SharedLibrary = SharedLibrary
Everything seems to work correctly for the most part. The main repo will recognize the subrepos, and I can do things like hg status -S on the main repo and it will recurse through the subrepos. commit also seems to work correctly.
When I try to clone from Stable (main repo), it fails when attempting to clone the ProjectA subrepo with the following message:
unknown revision 'a855f4fe17c393d5863409f1443fc93b36787fa9'
[command returned code 255 Mon Mar 12 09:25:47 2012]
However, I have verified that the revision is correct and present in the ProjectA subrepo. I can clone each subrepo without any problems.
So far I have tried:
1) Deleting each repository and starting over.
2) Re-installing TortoiseHg/Mercurial.
3) Making sure the revision listed in .hgsubstate is correct and present in each subrepo.
Any way to fix this?
EDIT:
When the clone of the Stable (main) repo fails, it leaves the target directory with a clone of Stable without any subrepos. I can go to the cloned Stable, do an hg update tip, and it will successfully clone the ProjectA subrepo but fail to clone SharedLibrary with the same 'unknown revision' error. I can then run hg update tip again, and it will successfully clone the SharedLibrary subrepo. At that point everything is correct as it would be if the clone had worked correctly in the first place.
EDIT 2: Contents of .hgsubstate:
a855f4fe17c393d5863409f1443fc93b36787fa9 ProjectAd72ef29a5656e5413322c1d20d5830448d558605 SharedLibrary
There is no space between ProjectA and the changeset id for SharedLibrary, but I guess that is just the way Mercurial does it. Both changesets in .hgsubstate are present in the respsective subrepo.
EDIT 3: hg log --debug -r tip from ProjectA subrepo. showing correct changeset is present
Z:\Programming\KSuite\Stable\Client\KClient>hg log --debug -r tip
changeset: 4:a855f4fe17c393d5863409f1443fc93b36787fa9
tag: tip
parent: 3:eb01e88027c893267422fcb67f035ba31d8cdbdc
parent: 2:5b5ffd7f96915ca792507820ccfbee35707148d0
manifest: 4:e90960833c0708ec7f99ccded11c46ca45b46542
user: Casey ******** <*redacted*#.com>
date: Fri Mar 09 18:22:50 2012 -0500
files: .hgignore
files-: KClient.suo
extra: branch=default
description:
Merging changes in Stable to Dev.
I run the following hg command and see a whole bunch of revision numbers & their messages fly past my screen, but when it finishes the destination hg repository is empty.
hg convert -s p4 //depot/proj1/... c:\hg\proj1 --config convert.p4.startrev=1267
What am I doing wrong?
When in doubt, use the summary command. You'll probably see something like this:
$ hg sum
parent: -1:000000000000 (no revision checked out)
branch: default
commit: (clean)
update: 15225 new changesets (update)
This says "nothing checked out, on the default branch, nothing to commit, 15225 changesets if you update".
An empty repo looks like this:
$ hg sum
parent: -1:000000000000 tip (empty repository)
branch: default
commit: (clean)
update: (current)
The repository is not empty. There should be an empty directory, .hg, which contains the whole history of your project.
If you want to see the state of your repo at the latest revision, you can update your local copy with hg update.
It turned out my Perforce database had a bit of corruption in very early changesets. Once I told the convert extension to start at a later change set, the conversion went without a hitch.
I have a hg respository located in a ~/Server folder on my computer. when I run hg summary from the root of that project, I get the following:
parent: 98:408483c17026 tip
final proposal page set up
branch: GS_Clients
commit: 6 deleted (clean)
update: (current)
So I wanted to make a backup copy of this project in my dropbox folder, so I ran :
hg clone <current_source> ~/Dropbox/Repositories/<new_source>
yet when I run hg summary in the new directory, is states that it is at revision 0:
parent: 0:b03c2c025c61
inital commit
branch: default
commit: (clean)
update: (current)
I've tried all manners of pushing,pulling and updating, but I can't get the new repo up to date.
How can I make a clone that is up to date, and/or how can I get this repo up to date.
Your first summary is on branch GS_Clients, while the second one, because it is a fresh clone, is on the default branch. Try hg update GS_Clients.
The update: (current) line only means you're at a head of the current branch.
I figure only rev 0 is on the default branch, and all your other commits are on GS_Clients or other named branches. Commands like log, glog, and UIs like TortoiseHg would have made that pretty obvious, where summary does not.
I made a mistake and removed a file. I'd like to go back to my previous commit!
I tried with revert and backout with had no luck...
Any tip?
Edit: I did exactly this:
hg forget file
hg commit -m "Blah"
hg push
The revision number of this last push is 17.
Now file is not tracked anymore. I'd like to get it back to revision 15 (not the inmediate previous rev, but one extra step back) as i do not want to keep working on the file in rev 16.
Found a solution:
hg revert file -r15 //(reverts file to revision 15).
If you have committed then you could update to previous version. If the file is version controlled, it is not going to go away. Thats what version control are for.
hg update -r "what is previous rev"
If you have removed a file and had not committed, then simply do the update and it will restore the file.
hg update
[edit: based on edited question]
hg revert file -r 15
hg update file -r 15
Try pulling version 15 and hg pull -r and then adding the file.