Jenkins plugin for mercurial cannot find revision - plugins

My jenkins fails when checking out a particular branch fom a repo I have in bitbucket. It only happens with this repo and this branch as other works perfectly. The error is "unknown revision BRANCHNAME" where branchname is the name of my branch.
I still don't get why the mercurial plugin for jenkins don't use --b (branch) in spite of --rev (revision) when you are configuring a branch. But anyway the following has worked with command line:
Cloning specifying the branch name
Cloning specifying the branch name as --rev argument
The mercurial plugin for Jenkins uses the "--rev" when you configure a branch in a strange way. First it clones the branch with --rev and then updates the branch to this revision, and is this moment when it fails.
In fact when I am checked out in this branch and I do "hg branches" this branch is not shown.
Any ideas?

Related

how to fork a repository in mercurial

I have a mercurail repo sg and it's path is https://merc.server.repo.com/hg/CS/sg/
if i clone it and check for branch , i get default branch as the master branch.
hg branch
default
I want to fork this repo and create another repo sg1 from this repo and path should be https://merc.server.repo.com/hg/CS/sg1/
And when for new repo i do "hg branch" ,it should be same results. That is "default" should be the master branch in new repo as well.
hg branch
default
I do not have the login for the mercurial server. How can i do this?
Also we are not using guthub /bitbucket etc.
Any suggestions are welcome. If you can provide steps that would be really helpful.

Checking out a github release in Eclipse egit?

How do I set egit to pull a release from github, rather than just the master?
I'm looking to checkout a release 0.4.0.
In the attached, the item checked out isn't pulled from remote - in properties the rebase, remote and upstream branch aren't set. I got this checkout from the tags, but it isn't correct.
You have already checked out the right commit: the head of your current branch v0.4.0-branch is the commit 23d3472 that is tagged as v0.4.0.
In Git a tag references a commit, not a branch. One commit can be in or even the head of multiple branches. For a release, a tag instead of a branch is usually used if the release is not intended to be maintained. Instead, contributions are welcome on top of the latest stage/commit of a specific branch (to avoid merging or rebasing), mostly on the master or on a dev(eloper) branch.
In your case, to contribute to VCVRack/Rack:
In GitHub fork the VCVRack/Rack repository (assuming you are not member of this project)
In Eclipse clone the forked GitHub repository
In Eclipse commit and push your proposed change as a single commit to the master branch of your forked GitHub repository (currently, there are 177 commits to master since the v0.4.0 tag)
In GitHub create a pull request based on this commit

Pulling latest changes from mercurial forked repository in a branch

Consider two repositories, production and stage. I have a branch in production repository called stage-branch. What I am trying to achieve is to merge latest changes from stage repository into that branch.
And everything went well, I cloned my production repository I pulled stage repository and merged under stage-branch.
What is unexpected though is that the default branch in my production repository now has been replaced by the default branch of the stage repository, which was not intended. I have just committed my merge changes under stage-branch in production repository but when I push I get a notification that there is a new head in my default branch.
How can I keep or revert my default branch to the state it was before pulling and merging?
EDIT: Production repository is a fork of stage repository, is it logical that the tip is getting automatically to latest revision of the pulled repository?
When your push or pull something in Mercurial, by default everything (and not just the current active branch, as it is in e.g. Git) will be pushed/pulled. If you would only like to push or pull a specific branch, you'll have to use the -b option.
From hg help pull you'll for instance see:
-b --branch BRANCH [+] a specific branch you would like to push
So if I understand your problem correct, it sounds like you doing a hg pull -b stage-branch should be the right thing to do.

Updating forked GitHub repo to match original's latest code and commits

I forked a GitHub project several days ago and from its issues, I can see that the master branch has had some modifications since.
When I cd to my location directory of this project and use git pull, it says, "Already up-to-date". Why?
How do I update my fork to include the commits from the original repo?
When you fork a repository, a copy of the original repository is established on your GitHub account. This permits read+write access to the "copy".
When the original repository resource has commits that would benefit your copy, follow these steps to update your fork's master branch. You could update other branches, but typical workflow is to update master against the original repository.
Open a Terminal
cd to your project directory
git remote add upstream <url-of-original-repository>
git branch and verify you are on master branch
git pull --rebase upstream master
Step #5 will fetch all new commits of the "original" repository, apply them to master branch from the last merge-base, then include all of your branch's commits "on top".
Any time you need to update your fork again, simply run the command in step #5.

How can I create new branch from default branch in Mercurial?

I have the branch name default which is my production branch. Now I want to create development branch from there and work separate on it.
How can I do that without affecting my default branch
Commit or shelve all your current changes, then:
hg branch Name_Of_Branch
This will switch your working code to a branch called *Name_Of_Branch* - N.B. this branch will not exist in the local repository until you do a hg commit and will not exist for anybody else until you have done a hg push, (or an accepted pull request to an administrator), and they have done hg pull.