0

I'm trying to create an alias and allows me to commit my changes and push all changesets for the current branch.
I'm running this from a Windows command prompt.

I've read this question and this question and so far have this:

ci-push = !hg ci -m $1 && hg push -b .

When I try this i get the error:

abort: Commit: The system cannot find the file specified

If I try:

ci-push = !hg ci -m %1 && hg push -b .

then it appears to work (prompts for auth and pushes the commit), but my commit message is:

%1

Is this even possible from a Windows cmd prompt?

Community
  • 1
  • 1
SteB
  • 1,999
  • 4
  • 32
  • 57

1 Answers1

2

On Windows, %USERPROFILE%\mercurial.ini:

[alias]
ll = log -l$1

Testing:

>hg ll
abort: too few arguments for command alias

> hg ll 5
changeset:...

Shell alias (%USERPROFILE%\mercurial.ini):

[alias]
ld = !hg log -r $1 && hg diff -r $1

Testing:

>hg ld 154
changeset:   154:5bb3aba44eab
....

diff -r 5bb3aba44eab ....

P.S. When using $N with spaces you should use quotes (!hg ci -m "$1" ... in aliases).

Dmitry Sokolov
  • 3,118
  • 1
  • 30
  • 35