CodePlex TortoiseHG Error while Pushing - mercurial

I get this error when i pushed my new source code on codeplex.
Could you please help fast. Thank you.
% hg outgoing --template {node}^M https://hg.codeplex.com/mxspli
comparing with https://hg.codeplex.com/mxspli
searching for changes
[command completed successfully Sat Apr 30 15:28:52 2016]
% hg log -T {rev}^M -r 1:2
[command completed successfully Sat Apr 30 15:28:52 2016]
% hg push https://hg.codeplex.com/mxspli
pushing to https://hg.codeplex.com/mxspli
searching for changes
http authorization required for https://hg.codeplex.com/mxspli
realm: CodePlex
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: transaction abort!
remote: rollback completed
[command returned code 1 Sat Apr 30 15:29:12 2016]
mxspli%

Ok, so i figured it out.
The error was that the files in the .hg folder were corrupted, so this is what i did:
Deleted the .hg folder.
Pulled the source to a new folder.
Moved the files from the old folder to the new folder.
Pushed the files.

Related

TortoiseHg - How to remove files from a branch after pushing to remote repository

I have modified, committed and pushed: fileA, fileB, and fileC. I should only have pushed "fileA" and "fileB", and my pull request has been declined due to this unwanted fileC.
Baring in mind that I have pushed these changes to the remote repository, is there a way for me to fix this locally so my pull request will not include fileC any more?
Simply create a new head with all necessary commits, starting to branch-off at the same parent where your 'wrong' changeset is based on. Then create a new pull-request for that new head you thus created.
Afterwards, you can opt to remove the unwanted head with the changeset(s) which include the unwanted fileC, however that should not be necessary. The strip command will come in handy for that (it's an extension and needs activation in your mercurial config file)
There are 2 ways doing that:
1- Fixing the repository and correcting the history so your incorrect commit is also cleaned from the history:
a- do a git log:
Desphilboy#computer:~/workspace/project(master)$ git log
commit dee4f318231b07ca3dbf213579dbfdeb89f72591
Author: Desphilboy<desphilboy#yahoo.com>
Date: Wed Jul 13 11:04:43 2016 +1000
feat(project): this is a wrong commit pushing FileC
commit e9772baa0abefc3423db2e6b518c71bade74abd9
Author: Somebody else<someoneelse#yahoo.com>
Date: Tue Jul 12 12:05:18 2016 +1000
feat(project): added new API endpoint
....
b- do a reset --soft to the hash code before that wrong commit:
Desphilboy#computer:~/workspace/project(master)$ git reset --soft e9772baa0abefc3423db2e6b518c71bade74abd9
this will revert your commit while keeping all your changes. if you do a git status now you will see all your changes after that commit
c- delete FileC and do another commit and push it again using -f switch
Desphilboy#computer:~/workspace/project(master)$ rm FileC
Desphilboy#computer:~/workspace/project(master)$ git rm FileC
Desphilboy#computer:~/workspace/project(master)$ git add .
Desphilboy#computer:~/workspace/project(master)$ git commit -m "some commit message"
Desphilboy#computer:~/workspace/project(master)$ git push -f
2- Keeping history:
you can simply delete the fileC, remove it from repo, commit and push your local to the master again. this will correct your problem but there will be an additional commit to the master and it will be shown in the history.

Mercurial pull creates (useless?) bundles

I have noticed by mercurial repository expanding in size when ever I use repo B to pull changes from repo A.
It seems that TortoiseHG creates files like hg-bundle-r3e6uf.hg10un under .hg directory. These files are usually 1-2MB in size each, so nothing too big, but together they create a lot, and can be an annoyance when doing backups.
This does not seem to happen if I pull changes instantly without reviewing them, or if I use repo A to push changes to B.
These bundle files seem useless as they are not copied when cloning the repository B.
Also the cloned repo is almost half smaller without them, so it is like data in these files wasn't moved to other files either.
Is it possible to:
A) Avoid creating these bundles on pull. (Pushing is option only when I have access to both repos)
B) Use some command to cleanup .hg directory. (Cloning is not very elegant)
EDIT:
When I select 'Incoming' first bundle is created:
% hg --repository C:\temp\hg\testB incoming --quiet --bundle c:\docume~1\username\locals~1\temp\thg.hlngus\CtemphgtestA_iavzew.hg C:\temp\hg\testA
1:d806c8cb0355
2:e0e3b20d5cb2
3:4e803a7ecefc
[command completed successfully Fri Aug 02 09:59:12 2013]
and then 'Accept', the second bundle is created:
% hg --repository C:\temp\hg\testB pull --verbose c:\docume~1\username\locals~1\temp\thg.hlngus\CtemphgtestA_iavzew.hg
pulling from c:\docume~1\username\locals~1\temp\thg.hlngus\CtemphgtestA_iavzew.hg
searching for changes
all local heads known remotely
3 changesets found
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 1 files
(run 'hg update' to get a working copy)
[command completed successfully Fri Aug 02 10:00:10 2013]
Where as using 'Pull' directly, no extra bundles are created:
% hg --repository C:\temp\hg\testB pull --verbose C:\temp\hg\testA
pulling from C:\temp\hg\testA
searching for changes
all local heads known remotely
3 changesets found
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 1 files
(run 'hg update' to get a working copy)
[command completed successfully Fri Aug 02 10:01:52 2013]
It seems this is TortoiseHg specific issue. Solution is either use push or use pull directly from command line to avoid extra bundles. Only (safe) way to cleanup seems to be the repository cloning.

Hudson - Can't Poll Mercurial

I have Hudson 2.1.2 (not Jenkins) and I've set my projects up to poll my Mercurial repository hourly to check for changes. I generated a public key for my hudson user and added it to the authorized keys on my Mercurial server. When doing the hourly poll, sometimes some projects can't poll Mercurial. Here's an example of what I see in the Mercurial Polling Log:
Started on Apr 30, 2012 2:00:30 PM
[workspace] $ /usr/bin/hg incoming --style /opt/home/hudson/jobs/MyProject/workspace/tmp7506244240405638202style --no-merges --rev default --newest-first
remote: ssh_exchange_identification: Connection closed by remote host
abort: no suitable response from remote hg!
Done. Took 5.3 sec
No changes
However, if I click on "Build Now", it sucessfully polls, picks up changes and builds.
Started by user sdoca
Cleaning the workspace because project is configured to clean the workspace before each build.
$ /usr/bin/hg clone --rev default ssh://hudson#my.mercurial.server:22//opt/hg/current/MyProject /opt/home/hudson/jobs/MyProject/workspace
requesting all changes
adding changesets
adding manifests
adding file changes
added 31 changesets with 40 changes to 11 files
updating working directory
5 files updated, 0 files merged, 0 files removed, 0 files unresolved
[workspace] $ /usr/bin/hg log --rev . --template {node}
[INFO] Using bundled Maven 3 installation
[INFO] Checking Maven 3 installation environment
...
<snip>
Any ideas why I get an error on the auto poll?

Can't clone Mercurial subrepo from main repo, fails with 'unknown revision'?

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.

Mercurial heads

Here's what I did. I don't want two heads. How do I fix this?
~/src: hg push
pushing to ssh://hg#bitbucket.org/Neil/project
ruprojecting ssh hg#bitbucket.org 'hg -R Neil/project serve --stdio'
searching for changes
new remote heads on branch 'default'
new remote head e04226a528b5
abort: push creates new remote head e04226a528b5!
(did you forget to merge? use push -f to force)
~/src: hg push -f
pushing to ssh://hg#bitbucket.org/Neil/project
ruprojecting ssh hg#bitbucket.org 'hg -R Neil/project serve --stdio'
searching for changes
14 changesets found
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 14 changesets with 30 changes to 67 files (+1 heads)
remote: bb/acl: Neil is allowed. accepted payload.
~/src: hg pull
ruprojecting ssh hg#bitbucket.org 'hg -R Neil/project serve --stdio'
pulling from ssh://hg#bitbucket.org/Neil/project
searching for changes
no changes found
~/src: hg heads
changeset: 1177:e04226a528b5
tag: tip
parent: 1175:b5f77a454e64
user: Neil
date: Sat Feb 25 09:12:48 2012 -0800
files: src/experiments/distribution_combination.py
changeset: 1176:f7cc8d94f4f3
parent: 1162:b680e6f93f80
user: Neil
date: Thu Feb 23 15:32:36 2012 -0800
files: .hgignore src/CMakeLists.txt etc.
If you don't want additional heads - don't do it
Instead of dumb push -f:
hg incoming && hg pull
hg merge
hg commit
hg push
hg merge
That will prompt you to merge the two heads back into one. Rather, it will merge everything it can automatically, and prompt you about conflicts. Afterwards you can diff the result and submit it as a new changelist.
This is usually an indication that someone else has pushed since you last pulled. While you can provide the -f flag to force the push, as you have seen this just results in a new head.
The solution is to update to the head that you want to merge into, and run hg merge, then commit/push.