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

2

8

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

Schnell answered 19/4, 2012 at 15:12 Comment(0)
E
9

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.

Errand answered 19/4, 2012 at 16:19 Comment(3)
thx Martin. Is there anyway I could hard code my commit message in this hgrc file ? If yes, pls tell syntax for this problem. Right now I need to click the copy message drop down every time and click some message before clicking commitSchnell
If you want to hard-code the commit message too (not really recommended — if you don't care about the commit messages, then just setup a periodic backup process instead) then you can use hg commit -m "your message" from the command line. That is, stop using the GUI part of TortoiseHg and put hg commit -m "auto commit" and hg push into a small commit.bat file.Errand
Agree. Bat file is best sln since I can just short cut it to the desktop and all magic can happen with a single mouse click. thx for ur help.Schnell
N
21

There's actually an option in TortoiseHg to do this:

  1. From your Commit window click on the "Options" button next to the "Copy message" button you've been using.
  2. This pops up a window with a few options - the third one down is "Push After Commit". Tick that.
  3. Enter "default" into the box next to the option
  4. 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.

Nils answered 19/4, 2012 at 19:25 Comment(1)
thanks Steve, +1 for this cool trick, but selecting Martin's ans since as you said it works from command line also. Now the only thing missing is if somehow somewhere in TortoiseHG I could hard code my commit message. Right now I need to click the copy message drop down every time and click some message before clicking commit. Any way this can be done ?Schnell
E
9

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.

Errand answered 19/4, 2012 at 16:19 Comment(3)
thx Martin. Is there anyway I could hard code my commit message in this hgrc file ? If yes, pls tell syntax for this problem. Right now I need to click the copy message drop down every time and click some message before clicking commitSchnell
If you want to hard-code the commit message too (not really recommended — if you don't care about the commit messages, then just setup a periodic backup process instead) then you can use hg commit -m "your message" from the command line. That is, stop using the GUI part of TortoiseHg and put hg commit -m "auto commit" and hg push into a small commit.bat file.Errand
Agree. Bat file is best sln since I can just short cut it to the desktop and all magic can happen with a single mouse click. thx for ur help.Schnell

© 2022 - 2024 — McMap. All rights reserved.