Is there any way to get the details of the commit? At the moment when I go to changes I can see the following:
but I'd be great to be able to see the commit details (e.g redmine does it )
.
I use Mercurial.
You need to activate another repository browser for this (e.g. hgweb):
Related
This is NOT another what are bookmarks/what are branches question - I have read all of these posts and now want to clarify some things about correct usage.
I am developing a website. I want a stable version, and a development version.
So I create two bookmarks 'stable', and 'development'.
If i want to create a new feature I update to the development bookmark, and create my feature.
If i want to correct a typo I do it directly in the stable version.
My confusion is as follows.
I have a central repository at bitbucket.
If i use hg push my bookmark data is not passed. If i do hg push -B stable or hg push -B development respectively then my bookmark data is pushed.
I then have two servers, a testing server and a live server.
If I ssh onto the server and do a hg pull from bitbucket because the bookmarks are not present on the server, what is pulled, and what then is the working copy updated to when I use hg update?
The correct usage for what I want, I believe is as follows. A local repository with my two bookmarks 'stable' and 'development'. I switch between the two as required and push them to bitbucket with hg push -B bookmark-name. Then I login to my testing/live server respectively and pull the correct bookmarked version.
Once I have tested my development bookmark I can merge it with my stable one and pull it onto the live server.
My concern and as such my question is what happens If i accidentally forget to specify the bookmark when pulling to the live server for example?
Thanks
Pulling
From Mercurial 2.3, pulling gets the remote repository's bookmarks as well. Before, you had to specify -B <bookmark> to get bookmarks as well as changesets. So your server repositories will have the right bookmarks after pulling.
If you're using an earlier version, you'll have to pull -B <bookmark> to get the bookmark as well. Of course, you can do that anyway, if you'd prefer not to pull all development changesets onto your live server.
Updating
Using hg update with no arguments will get you tip, which is always the last changeset added to the repository, whether that's stable, development or accidentally un-bookmarked (actually, it'll get you the last changeset added to the current branch, but it sounds like you're not using named branches). To get consistent results when updating, I'd recommend you be explicit about which bookmark you want each server repository to update to. If you're worried about forgetting to specify, use scripts to automate your update process.
The correct usage IMHO is to use named branch instead of bookmark.
I treat bookmarks as local tags and no more. So if I'm wanting to push tagging information then I use actual tags to mark stable releases. Every time I do a release I mark it such as "rel-2.4" for example.
Then on live I can update to the latest revision and know that that is the last good release. My "dev" is simply the head of the default branch and I keep adding new bits of development into it. This way you can just do a push and not worry about the bookmarks.
This might not be what you want or you envisage but it is a workable solution for the situation you describe.
Should we have a fix that we need to do (a typo in your example) I can update to the last release, correct the type, test and if happy tag it as the next release (rel-2.41). Merge that new branch back into default so my dev branch has the fix too. Jump on the live server and pull/update to rel-2.41
Is that any good to you?
I would like to be able to present a view of Jenkins builds similar to the buildbot console view. With Jenkins out of the box, there appears to be really no good way to associate a commit with a build. You have to access the specific built to determine what commit it was building.
I would like to be able to show status on what commits have been tested in a particular branch, so we know if a commit was skipped or if the latest commit has not yet been tested.
I tried using the Jenkins API for this, but I found that I could only see the SHA1 hash for a git commit via the build itself, i.e. via http://server/job/job-name/388/api/json. So, the only way I can see to take a commit and find builds for it is to iterate through every build in a job and retrieve its associated build info. This is certainly not going to be efficient and fast. Is there another way to do it?
Imperfect Answer: put the "revision number" you care about in the package name of all related artifacts, and use the "fingerprint" feature.
For example: my "product package" artifacts have a revision number, and if I carried that through to the "test package" artifact (which includes the unpacked product artifact) you would be able to track that revision number via the "artifact/fingerprint" feature, and show which test jobs used it. Below, you can't tell with a single click which test used which "commit."
I have some changed files I don't want to commit (e.g. web.config). Before I pull and update to new changesets, I have to shelve them. After the pull & update, I have to unshelve them.
I'm currently using TortoiseHG. Is there any extension which can do this automatically?
I'd suggest something else: instead of always shelving and unshelving, you could use two different config files: one which is part of the repository and contains dummy/example data, and another one which each user really uses locally, which is ignored by Mercurial.
Check out this answer for a more detailed explanation what I mean.
The example I'm giving there is for Visual Studio, and I see from your other questions and answers that you're apparently using .net and Visual Studio, so you can just use my example exactly as written.
In Mercurial, just hg pull -u. Uncommitted changes are merged with the tip. Same result as shelve, pull/update, unshelve. With TortoiseHg a dialog will come up prompting for discard/shelve/merge.
You may get a merge dialog this way but that would be true with the shelving approach because unshelve may have to merge as well. From the command line you won't get a prompt if there are no conflicts. TortoiseHg may have an option to suppress the dialog if there are no conflicts, but I haven't checked.
I would try a few different things with this.
Regarding the Web.config file in particular, you might want to look at using local configuration files for overrides instead of leaving local changes uncommitted. (e.g. referencing an separate file that is in .hgignore). Projects I've worked on in the past did this to separate test/prod configurations from the settings for development, or vice-versa.
I don't think there is any extension which will do this for you, but you might be better off writing a quick batch or powershell script to do this workflow for you. On previous projects, I had a script which would do something similar in that it would do a pull/update/rebase to keep my changes at the tip (I was working with hg against an SVN server which made that important.)
I know I didn't answer your question directly, but I hope this helps!
Direct answer: https://pypi.org/project/hg-autoshelve/
But a dedicated repository for configuration files seems a better idea as suggested by
Christian Specht there
If I set up a central Mercurial Repository where certain people are allowed to push to it, what convenient way can I monitor the changes going into that repository?
I'm used to using SVN-Monitor for Subversion. It runs in the task-bar and lets me know whenever something new has been checked in to the repository.
Is there a similar solution for Mercurial ?
This tool looks like it might be what you're after.
Use a RSS feed monitor and point it to the repo's atom/RSS feed (found in the web interface).
Something like this should do nicely: https://superuser.com/questions/9929/rss-notification-in-system-tray
Alternately you could set up a changegroup hook on the repo to be watched and have it trigger something on your system, but polling is probably okay for this.
If you are currently using TeamCity or looking for a Continuous Integration solution:
TeamCity has various apps/plugins like a VisualStudio plugin and Windows TrayIcon for build notifications. You set up a project in TeamCity to build when someone commits to the repository. When someone commits it triggers a build, which will send a notification to you. A bonus is that it tells you if the build succeeded or failed ==> {good code or bad code}
Been giving HgAssist a try it works pretty well.
I'm working on setting up a Hudson/Mercurial stack for development. One of the use cases I have is "As a developer, I want to update my local sandbox to a particular build number from Hudson, so I can [fix a bug, debug issues, create a branched version of code, etc.]."
So, if I see build #49 on Hudson, how do I update my local Mercurial repo to the same source code that was used to build #49?
Note: I have looked at Mercurial tags, however they don't seem quite appropriate. They require a commit, so it seems the commits will dirty up the history (each commit by a developer will show a subsequent commit from the tag operation). If this is the best there is, I guess I will have to live with it, but hoping for something better. Would probably still use tags for releases.
Ok, here's the solution I ended up with:
Using the Description Setter Plugin, I set both the success and failing build description to "Mercurial ${MERCURIAL_REVISION}". Turns out the current Mercurial SCM plugin sets this environment variable to the parent changeset id.
I can then look at a build on Hudson, and if so desired, grab the changeset id and do a "hg update " on my local repo to get that revision of code.
Note that in the Mercurial plugin issue tracker there is some talk of changing this to HG_REVISION instead and adding other environment variables, so this may break at some point in the future, but works for me for now.
You can use the keywords extension on the hudson system to update the nodeid into some aspect of the build, possibly including the artifact names. If the Hudson job output artifacts are like: myproject-2010-02-17-2dbf7575fa46.tar.gz you certainly know how to 'hg update' to that point in time.
The keywords extension and maybe a little ant-fu make that easy to do.