How do I close a mercurial branch via SourceTree UI? - mercurial

Is there a way to close a branch via the SourceTree interface, rather than via the command line for mercurial (hg)?

Right-click on the branch in the sidebar, and select Close <branch-name>...

Related

How can I suppress TortoiseHg "new branch in remote repository" warning?

I use TortoiseHg as my version control solution. Because I put every feature on a separate branch, I often create new branches. Each time I want to push a new branch, I am presented with a warning about creating a new branch in the remote repository:
I am somewhat annoyed by this, because I can't think of a reason not to create a branch in the remote repository when I am pushing changesets on this branch. Is there any way I can tell TortoiseHg to always push new branches to the remote repository?
In the Synchronization view (ALT-4), click the Options button and select "Allow push of a new branch":

tortoisehg one step commit push - how to and where is the log file

Iam using win xp with Tortoisehg 2.3. I use bit bucket to backup my personal source code. (rarely for true version control, more as a source backup store). Right now I have to right click on my repo, select commit, then enter a commit message ( i choose to just copy the same message I used last time, there is a drop down to do this), then click commit. Then I again right click and select synchronize and go thru this option to finally push. I could use the workbench and do something similar. I want to optimize this process so I decided to just write a dos bat script to commit and push. When I push Tortoisehg spits out the hg command to the window and you can see it and cut and paste from here. For the commit it does not show what it is really doing under the hood. When I used TortoiseSVN long back I recall there was a logfile where all svn commands executed were stored for debugging. So I started searching for a TortoiseHg logfile.
Does anybody know:
1) Does Tortoisehg have a logfile somewhere where it stores all mercurial commands executed complete with all the command line options ?
2) Is there a better way to do a one step commit push (via Tortoisehg gui or bat or some addon/extension etc)?
regards
There's actually an option in TortoiseHg to do this:
From your Commit window click on the "Options" button next to the "Copy message" button you've been using.
This pops up a window with a few options - the third one down is "Push After Commit". Tick that.
Enter "default" into the box next to the option
Click "Save in Repo" so that it is saved for next time
Now it will push to the default push target every time you commit from TortoiseHg. One thing to note is that this won't result in an automatic push if you commit from the command line whereas Martin's solution will.
1) Does Tortoisehg have a logfile somewhere where it stores all mercurial commands executed complete with all the command line options ?
TortoiseHg is actually not very related to TortoiseSVN — the two projects share almost no code and are developed by different groups. So I don't think that there is a log file for TortoiseHg even though TortoiseSVN has one.
2) Is there a better way to do a one step commit push (via Tortoisehg gui or bat or some addon/extension etc)?
You could setup a post-commit hook. Add this to the .hg\hgrc file for your repository (create the file as needed):
[hooks]
post-commit = hg push
That way you will run hg push after every commit, even when the commit is done from TortoiseHg.

Mercurial and online sharing - how to proceed

A noob question... i think
I use Mercurial for my project on my laptop. How do i submit the project to an online server like codeplex?
I'm using tortoisehg and i cant find the upload interface for submit the project online...
From the command line, the command is:
hg push <url>
to push changes a remote repository.
In TortoiseHg, this is accessed through the "Synchronize" function, which seems to show up if you right-click in a Windows Explorer window but not on any file. It's also available in the workbench; the icon is 2 arrows pointing in a circle.
For these things, I find the best way to go is to use the command line interface - TortoiseHG is OK if you need to perform some common operations from the file browser, and it's a nice tool to visualize some aspects of your repository, but it doesn't implement all of mercurial's features in full detail, and it renames and bundles some operations for no apparent reason.
I don't know how things work at codeplex, but I assume it is similar to bitbucket or github, in which case here's what you'd do:
Create an empty repository on the remote end (codeplex / bitbucket / ...).
Find the remote repository's URL - for bitbucket, it is https://bitbucket.org/yourname/project, or ssh://hg#bitbucket.org/yourname/project.
From your local repository, commit all pending changes, then issue the command: hg push {remote_url}, where {remote_url} is the URL of the remote repository. This will push all committed changes from your local repository to the remote repository.
Since the remote's head revision (an empty project) is the same as the first revision in your local copy (because all hg repositories start out empty), mercurial should consider the two repositories related and accept the push.
For an introductory guide to command-line mercurial, I recommend http://hginit.com/

Is it possible to use the Mercurial Fetch extension with the TortoiseHg merge dialog?

I'm trying to implement Mercurial in the company where I work. Previously we used ClearCase, but for various reasons we decided to upgrade to Mercurial. The development team is very accustomed to the ClearCase workflow, especially the visual tools. Therefore, for our implementation of Mercurial, we will be using TortoiseHg.
A Mercurial extension that caught my attention is the Fetch extension, which allows to do a "hg pull -u" followed by "hg merge" and "hg commit", if necessary. The extension basically does what we want and integrates perfectly with TortoiseHg configuring it to run automatically "Post Pull."
The only problem is that the Fetch extension does not allow to compile and test the merge before running the commit. However, using the TortoiseHg merge dialog with "hgtk merge -r tip" there is a visual way to run the merge command, but with the advantage of allowing me to compile and run the tests. If all went well I press the Commit button, but if something went wrong just press Undo and everything is back as before.
TortoiseHg Merge Dialog: http://www.freeimagehosting.net/uploads/a2f43fe5ff.png
So, my question is:
Is it possible to use the Mercurial Fetch extension with the TortoiseHg merge dialog?
If it's not possible, how would you recommend implementing this workflow? Is there a way to assign an Alias to this secuence:
hg pull -u
* if merge is needed *
hgtk merge -r tip
I am not sure if you could have an "if" in an alias, but I think not.
To answer your last question: no, there are no way to make such aliases with the command line version of Mercurial or with TortoiseHg.

How to serve my local Mercurial repository?

I created a repository with TortoiseHg. Is it possible to share it with other machines? Or do I need to install another application?
Right click your repository, TortoiseHG, Web Server menu option. That'll pop up a dialog, and you just hit the Start button.
Say your start port's 8000. Then on your other machines, right click in the folder where you want the new clone, select TortoiseHG, Clone a Repository. In the Source Path, put "http://originalmachine:8000/" and hit the "clone" button.
Web Server's great for temporary sharing. If you want something more persistent, that doesn't require a task sitting in your task bar, look here for instructions on how to get hgwebdir set up on Windows (but this requires Mercurial, rather than TortoiseHg).
Yep, just share the folder and have the other machines push/pull.
You can also right-click your repo and choose "Web server" under the TortoiseHG menu. This serves the repo over TCP/IP.