Adding hg strip to hgrc config file - mercurial

I have added strip extension hgrc config. (MAC OS)
cd ~
nano .hgrc
under [extension] added line:
strip =
Even vagrant restart or mac restart didn't help, the command is still not recognizable.
hgrc file:
[ui]
# name and email, e.g.
# username = Jane Doe <jdoe#example.com>
username = ....>
ignore=~/.hgignore_global
# We recommend enabling tweakdefaults to get slight improvements to
# the UI over time. Make sure to set HGPLAIN in the environment when
# writing scripts!
# tweakdefaults = True
# uncomment to disable color in command output
# (see 'hg help color' for details)
# color = never
# uncomment to disable command output pagination
# (see 'hg help pager' for details)
# paginate = never
[extensions]
uncomment these lines to enable some popular extensions
(see 'hg help extensions' for more info)
churn =
color =
strip =
[color]
status.modified = blue bold underline red_background
status.added = green bold
status.removed = red bold blue_background
status.deleted = cyan bold underline
status.unknown = magenta bold underline

You should replace
[extensions]
uncomment these lines to enable some popular extensions
(see 'hg help extensions' for more info)
churn =
color =
strip =
with
[extensions]
# uncomment these lines to enable some popular extensions
# (see 'hg help extensions' for more info)
churn =
color =
strip =
(you uncommented both the actual extension-enable lines and the explanatory comment which was intended to stay commented out)

Related

Mercurial is ignoring new files

How can I make new files show up in hg status output?
Newly created files in my project directory do not appear when I run hg status. If I run hg status --all, I see that they are ignored. I would expect that newly created files would be indicated as untracked and that I would have to manually ignore them, rather than the other way around.
The new file type is not listed in .hgignore nor do I have anything that should affect it in my mercurial.ini.
# .hgignore
syntax: glob
## Specific Files ##
## File Types ##
*~
*.pyc
*\#
## Directories ##
venv/*
.idea/*
.pytest_*
__pycache__/*
*/__pycache__/*
; mercurial.ini
[ui]
username = Lorem Ipsum <loremipsum#dolorsitamet.com>
editor = "C:\Program Files\emacs-26.1-x86_64\bin\emacsclientw.exe"
[pager]
pager = C:\Program Files (x86)\less-530-win32-static-x86\less.exe
[color]
mode = win32
[alias]
; Prevents creation of .orig files
undo = revert --no-backup
The trouble is that hash is not escaped correctly in .hgignore.
Incorrect
*#
Correct
*\#
The .hgignore file uses hash for comments. Without it, Mercurial interprets *# as just *. This tells Mercurial to ignore everything! That's why nothing was showing up in hg status.

How to get Beyond Compare to handle .hgtags files correctly?

We recently switched from P4Merge to BeyondCompare for working with our Hg repositories.
With P4Merge, when you merged branches, there was always a conflict in .hgtags, but just letting P4Merge do it's default action resulted in the correct merged .hgtags.
With BeyondCompare - it seems to just take one of the .hgtags, and not merge any of the differences. This results in loosing LOTS of tags.
How can we configure BeyondCompare to actually merge the changes for that file?
Using Beyond Compare 4.1.9 and Mercurial 3.7.3 on Ubuntu Linux 16.04, running hg merge after a pull and update for a conflicted .hgtags launched the .hgtags files in Beyond Compare's Text Merge and allowed me to merge them. It's possible there's an issue with your .hgrc configuration.
Here's the .hgrc that worked for diff and merge on my Ubuntu system:
[extensions]
# uncomment these lines to enable some popular extensions
# (see "hg help extensions" for more info)
#
# pager =
# progress =
# color =
hgext.extdiff =
[extdiff]
cmd.bcomp = bcompare
opts.bcomp = -ro
[merge-tools]
bcomp.executable = bcompare
bcomp.args = $local $other $base $output
bcomp.priority = 1
bcomp.premerge = True
bcomp.gui = True
[ui]
merge = bcomp
If you're using Windows or Mac, please let me know.

tortoise hg : how to get notified whe something pushed to a central repo

i am using Mercurial for version control. One central repo is shared among the team and any of us can push / pull to it.
How can i get notified when any other user push something to the central repo.
I have tried to edit my hgrc file as per the https://www.mercurial-scm.org/wiki/NotifyExtension
as below
[extensions]
hgext.notify =
[hooks]
# Enable either changegroup or incoming.
# changegroup will send one email for each push,
# whereas incoming sends one email per changeset.
changegroup.notify = python:hgext.notify.hook
#incoming.notify = python:hgext.notify.hook
[email]
from = **myemailaddresshere**
[smtp]
host = localhost
# presently it is necessary to specify the baseurl for the notify
# extension to work. It can be a dummy value if your repo isn't
# available via http
[web]
baseurl = **http://repoip:port/**
[notify]
# multiple sources can be specified as a whitespace separated list
sources = serve push pull bundle
# set this to False when you're ready for mail to start sending
test = True
[reposubs]
* = **toemailaddresshere**
#config = /path/to/subscription/file
# you can override the changeset template here, if you want.
# If it doesn't start with \n it may confuse the email parser.
# here's an example that makes the changeset template look more like hg log:
template = \ndetails: {baseurl}{webroot}/rev/{node|short}\nchangeset: {rev}:{node|short}\nuser: {author}\ndate: {date|date}\ndescription:\n{desc}\n
maxdiff = 300 # max lines of diffs to include (0=none, -1=all)
then i tried to push sme changes . But this didnt fire any email.
Can you please check what is error in my .hgrc file
Your Notify extension is configured to be in test mode. Maybe setting test = False will help?
template and maxdiff should be in the [notify] section. In your sample, they are in the [reposubs] section.
You can use hg help to check if the notify extension is enabled.

hg: unknown command 'extdiff''

I can't figure out why my extdiff extension is not working for Mercurial (on a Mac).
this is what my .hgrc file looks like:
[extensions]
fetch=
hgext.extdiff =
[extdiff]
cmd.kdiff3 =
[ui]
merge=kdiff3
[merge-tools]
kdiff3.executable=/Applications/kdiff3.app/Contents/MacOS/kdiff3
kdiff3.args = $base $local $other -o $output
and yet kdiff3 is recognized as a merge tool.. and can be run from the cmd line like "kdiff3". but what i'd like to do is use kdiff3 as a gui tool for comparing diff files.
like this:
hg extdiff -p kdiff3
this seems like the best way of using kdiff3 as a popup gui when using Mercurial.
I am new to this and am not sure if I am doing it right.
Thanks...!
By the way, when I try to run 'hg extdiff'
I get:
hg: unknown command 'extdiff'
'extdiff' is provided by the following extension:
extdiff command to allow external programs to compare revisions
use "hg help extensions" for information on enabling extensions
(even though it is in .hgrc)
Please note that merge-tool and external diff are different tools for different tasks.
For example you can use fmdiff script to use FileMerge for diff and k3diff for merge-tool:
Your .hgrc should be:
[extensions]
# enable external diff program
extdiff =
[extdiff]
cmd.opendiff = fmdiff
opts.opendiff =
[merge-tools]
# Override stock tool location
kdiff3.executable = /Applications/kdiff3.app/Contents/MacOS/kdiff3
# Specify command line
kdiff3.args = $base $local $other -o $output
# Give higher priority
kdiff3.priority = 1
Now you can use
hg opendiff myfile.ext
Please note that 'opendiff' is a custom wrapper name, so you can change it to your likes but it cannot be one of already reserver names.

abort: no username supplied (see "hg help config")

I have added repository and at the time of commit I get error as
error: abort: no username supplied (see "hg help config")
I am not getting Mercurial.ini file on my local as well. Does anyone know how I can resolve this error on Fedora?
Either put a hgrc in the .hg directory in your repo or put a .hgrc (hgrc for Windows) file in your home dir (then it covers all your projects)
In the file you should write
[ui]
username = Your Name <your#mail>
On Windows, these configuration files are read:
- "<repo>\.hg\hgrc"
- "%USERPROFILE%\.hgrc"
- "%USERPROFILE%\Mercurial.ini"
- "%HOME%\.hgrc"
- "%HOME%\Mercurial.ini"
- "C:\Mercurial\Mercurial.ini"
- "HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial"
- "<install-dir>\Mercurial.ini"
On Unix, these files are read:
- "<repo>/.hg/hgrc"
- "$HOME/.hgrc"
- "/etc/mercurial/hgrc"
- "/etc/mercurial/hgrc.d/*.rc"
- "<install-root>/etc/mercurial/hgrc"
- "<install-root>/etc/mercurial/hgrc.d/*.rc"
Include the following in one of these files above:
[ui]
username = Your Name <your#mail>
Simple answer - in your .hg folder, create a file named .hgrc
in there, add the following content (check hg help config for the exact syntax)
[ui]
username = forename surname <forename.surnamce#email.com>
verbose = True
and save it. Should work now. Note that verbose = True is not required, but I included it since it is listed in the help content
(This is from memory, but hg help config will tell you the correct filename and syntax)
run hg config --edit ( tested it in hg 3.1 both on linux debian and windows)
it will create (if not exists) and open a file with text:
# example config (see "hg help config" for more info)
[ui]
# name and email, e.g.
# username = Jane Doe <jdoe#example.com>
username =
[extensions]
# uncomment these lines to enable some popular extensions
# (see "hg help extensions" for more info)
# pager =
# progress =
# color =
fill "username" field and save the file
Make sure that the current user owns the hgrc file or otherwise has correct permissions for it.
put file .hgrc in $HOME or home/user