I have created a log alias in .hgrc file
nlog = glog --style=${HOME}/.hg-ext/templates.lg
Now in the templates.lg I use label function to colorize output
changeset = "{label('red',rev)} {label('c.author', author|person)} {desc|firstline|strip} {label('green', date|age)} {label('yellow', branches)}{label('yellow',bookmarks)}{label('yellow', tags)}\n\n"
changeset_verbose = "{label('red',rev)}:{node|short} {label('c.author',author|person)} {desc|firstline|strip} {label('green',date|age)} {label('yellow', branches)}{label('yellow',bookmarks)}{label('yellow', tags)}\n\n"
start_branches = " "
branch = "{label('yellow', branch)}"
start_bookmarks = " "
bookmark = "{label('yellow', bookmark)}, "
last_bookmark = "{label('yellow', bookmark}"
start_tags = " "
tag = "{label('yellow', tag)}, "
last_tag = "{label('yellow', tag)}"
When I run hg nlog it works ok on some repositories, but fails on others with follwing trace
C:\Users\esharapov\Repos\Composer.Hg>hg -v --traceback nlog
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 191, in _runcatch
File "mercurial\dispatch.pyo", line 924, in _dispatch
File "mercurial\dispatch.pyo", line 681, in runcommand
File "mercurial\extensions.pyo", line 195, in closure
File "hgext\color.pyo", line 518, in colorcmd
File "mercurial\extensions.pyo", line 195, in closure
File "hgext\pager.pyo", line 143, in pagecmd
File "mercurial\dispatch.pyo", line 1055, in _runcommand
File "mercurial\dispatch.pyo", line 1015, in checkargs
File "mercurial\dispatch.pyo", line 921, in <lambda>
File "mercurial\util.pyo", line 991, in check
File "mercurial\dispatch.pyo", line 537, in __call__
File "mercurial\util.pyo", line 991, in check
File "mercurial\extensions.pyo", line 195, in closure
File "mercurial\util.pyo", line 991, in check
File "hgext\mq.pyo", line 3516, in mqcommand
File "mercurial\util.pyo", line 991, in check
File "hgext\graphlog.pyo", line 64, in glog
File "mercurial\commands.pyo", line 5076, in log
File "mercurial\cmdutil.pyo", line 2219, in graphlog
File "mercurial\cmdutil.pyo", line 2196, in displaygraph
File "mercurial\cmdutil.pyo", line 1184, in show
File "mercurial\cmdutil.pyo", line 1489, in _show
File "mercurial\templatefilters.pyo", line 340, in stringify
File "mercurial\util.pyo", line 802, in increasingchunks
File "mercurial\templater.pyo", line 783, in _flatten
File "mercurial\templater.pyo", line 262, in runtemplate
File "hgext\color.pyo", line 501, in templatelabel
File "mercurial\templatefilters.pyo", line 340, in stringify
File "mercurial\templatekw.pyo", line 115, in _showlist
File "mercurial\templatekw.pyo", line 106, in one
File "mercurial\templater.pyo", line 938, in __call__
File "mercurial\templater.pyo", line 845, in process
File "mercurial\templater.pyo", line 835, in _load
File "mercurial\templater.pyo", line 181, in compiletemplate
File "mercurial\templater.pyo", line 173, in _parsetemplate
File "mercurial\parser.pyo", line 78, in parse
File "mercurial\parser.pyo", line 70, in _parse
File "mercurial\parser.pyo", line 50, in _parseoperand
File "mercurial\parser.pyo", line 41, in _match
ParseError: ('unexpected token: end', 26)
hg: parse error at 26: unexpected token: end
What could be the reason ?
I can't show you your mistake, but I performed some additional tests with strict correlations between condition and result
Preparation
Created $TortoiseHg\templates\map-cmdline.colorglog with content, identical to your templates.lg (I'm too lazy to write your long command on every test)
Found command-line in my 3.7.1, equivalent to your nlog (because hg: unknown command 'glog'): it's
hg log -G --style=colorglog
log -G and style without path, because style-file in default map-location with good name
Enabled Color Extension
Testing
Repo without tags (except mandatory tip) or bookmarks
>hg paths
default = https://bitbucket.org/albert_brand/hgexportfiles
>hg tags
tip 10:ee40a7b06166
>hg book
no bookmarks set
hg log - OK
Repo with tags and bookmarks
>hg paths
default = http://bitbucket.org/durin42/hg-git/
>hg book
master 987:be0d1413a06f
next 490:ac644c0e16d4
>hg tags
tip 987:be0d1413a06f
0.8.5 985:53d514c9c7e6
0.8.4 976:22a12bf143a3
0.8.3 946:d7ad67f850b2
0.8.2 926:e183fdc198f0
0.8.1 902:e6489cf3fe8c
0.8.0 857:cf3dafce0611
0.7.0 827:fc63d0e2653d
...
hg log - FAIL ("hg: parse error at 26: unexpected token: end")
Repo with tags and without bookmarks
>hg paths
default = http://bitbucket.org/durin42/hgsubversion/
>hg book
no bookmarks set
>hg tags
tip 1378:e1619c051788
1.8.5 1370:bd979667611d
1.8.4 1365:89997a5fc181
1.8.3 1347:759cafce6bec
1.8.2 1344:38be7a6b6def
1.8.1 1324:dde1ade36a49
...
hg log - OK
Additional tests with single tagged|bookmarked revisions in hg-git gepo
>hg log -r 985 --style=colorglog
985 Siddharth Agarwal init: mark Mercurial 3.7 as supported and prepare for 0.8.5 6 weeks ago 0.8.5
Tagged revision - OK
>hg log -r 490 --style=colorglog
hg: parse error at 26: unexpected token: end
Bookmarked revision - FAIL
ADDITION
OK, I catched it. As usual, obvious typo in obvious place. Instead of
last_bookmark = "{label('yellow', bookmark}"
it must be
last_bookmark = "{label('yellow', bookmark)}"
for obvious reason: label(), not label(
and bookmarked revision will not generate error anymore
Related
i am trying to use hg convert to delete specific public files and create new repo.
the commands throws an error at a particular revision. this is the error message. please let me know what this is about and how can i resolve this.
#!python
** Mercurial version (4.6.1). TortoiseHg version (4.6.1)
** Command:
** CWD: C:\WINDOWS\system32
** Encoding: cp1252
** Extensions loaded: fetch, keyword, strip, mq, purge, rebase, shelve, split, convert, tortoisehg.util.configitems
** Python version: 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]
** Windows version: sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='')
** Processor architecture: x64
** Qt-5.9.2 PyQt-5.9.1 QScintilla-2.10.2.dev1711012104
Traceback (most recent call last):
File "tortoisehg\hgqt\repowidget.pyo", line 889, in onRevisionSelected
File "tortoisehg\hgqt\revdetails.pyo", line 307, in onRevisionSelected
File "tortoisehg\hgqt\revdetails.pyo", line 328, in _setContextToFileList
File "tortoisehg\hgqt\manifestmodel.pyo", line 289, in setRev
File "tortoisehg\hgqt\manifestmodel.pyo", line 403, in _repopulateNodes
File "tortoisehg\hgqt\manifestmodel.pyo", line 431, in _populateNodes
File "tortoisehg\hgqt\manifestmodel.pyo", line 604, in _populaterepo
File "tortoisehg\hgqt\manifestmodel.pyo", line 634, in _populatesubrepos
File "mercurial\util.pyo", line 1437, in __get__
File "mercurial\context.pyo", line 166, in substate
File "mercurial\subrepoutil.pyo", line 61, in state
File "mercurial\context.pyo", line 1088, in data
File "mercurial\util.pyo", line 1437, in __get__
File "mercurial\context.pyo", line 702, in _filenode
File "mercurial\filelog.pyo", line 54, in lookup
File "mercurial\revlog.pyo", line 1494, in lookup
File "mercurial\revlog.pyo", line 1416, in _match
File "mercurial\revlog.pyo", line 812, in rev
WdirUnsupported
I am running Django Unit tests on CircleCI with 1 container setup. The tests run fine when I do not add Django's --parallel argument. However, when I add --parallel=2 to the test run, it fails with this cryptic error below.
I've tried both versions: with and without --keepdb - both fail with exactly the same error. The code for _clode_test_db appears to suggest that passing --keepdb=True should fail fast and return. See django/db/backends/mysql/creation.py line: 29 here [https://github.com/django/django/pull/4761/files]
Would appreciate any ideas on what is going on here
Using existing clone for alias 'default' ('test_django_learned')...
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/core/management/commands/test.py", line 74, in execute
super(Command, self).execute(*args, **options)
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/core/management/commands/test.py", line 90, in handle
failures = test_runner.run_tests(test_labels)
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/test/runner.py", line 532, in run_tests
old_config = self.setup_databases()
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/test/runner.py", line 482, in setup_databases
self.parallel, **kwargs
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/test/runner.py", line 733, in setup_databases
keepdb=keepdb,
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/db/backends/base/creation.py", line 219, in clone_test_db
self._clone_test_db(number, verbosity, keepdb)
File "/home/circleci/sliderule/venv/lib/python2.7/site-packages/django/db/backends/mysql/creation.py", line 48, in _clone_test_db
dump_proc = subprocess.Popen(dump_cmd, stdout=subprocess.PIPE)
File "/usr/local/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/local/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Exited with code 1
I could reproduce it and debugged the problem in my ubuntu container by adding
sys.stderr.write("dump_cmd: %r" % dump_cmd)
to site-packages/django/db/backends/mysql/creation.py and it gave me
dump_cmd: ['mysqldump', '--user=root', '--password=pass', '--host=db', '--port=3306', 'test']
So probably your container is also missing mysqldump which I fixed with a simple sudo apt-get install mysql-client.
When I put “hg —version” in my mac terminal, it shows below Error…
Traceback (most recent call last):
File "/usr/local/bin/hg", line 41, in <module>
mercurial.util.setbinary(fp)
File "/Library/Python/2.7/site-packages/mercurial/demandimport.py", line 106, in __getattribute__
self._load()
File "/Library/Python/2.7/site-packages/mercurial/demandimport.py", line 78, in _load
mod = _hgextimport(_import, head, globals, locals, None, level)
File "/Library/Python/2.7/site-packages/mercurial/demandimport.py", line 47, in _hgextimport
return importfunc(name, globals, *args)
File "/Library/Python/2.7/site-packages/mercurial/util.py", line 70, in <module>
statfiles = getattr(osutil, 'statfiles', platform.statfiles)
File "/Library/Python/2.7/site-packages/mercurial/demandimport.py", line 106, in __getattribute__
self._load()
File "/Library/Python/2.7/site-packages/mercurial/demandimport.py", line 78, in _load
mod = _hgextimport(_import, head, globals, locals, None, level)
File "/Library/Python/2.7/site-packages/mercurial/demandimport.py", line 47, in _hgextimport
return importfunc(name, globals, *args)
ImportError: dlopen(/Library/Python/2.7/site-packages/mercurial/osutil.so, 2): Symbol not found: _fdopendir$INODE64
Referenced from: /Library/Python/2.7/site-packages/mercurial/osutil.so
Expected in: /usr/lib/libSystem.B.dylib
in /Library/Python/2.7/site-packages/mercurial/osutil.so
How I fix this?
Thank you in advance for any help you can provide.
PS : Sorry for my poor English.
Finally I got Answer…!
Step1: Go to “/Library/Python/2.7/site-packages” folder.
>$ cd /Library/Python/2.7/site-packages
Step2: Remove below files in "site-packages" folder.
>$ rm -rf hgext
>$ rm -rf mercurial
>$ rm -rf mercurial-3.7.3-py2.7.egg-info
Step 3: Now install mercurial
I am unable to update mercurial repos on my machine. I get the following error when I do an update hg up --traceback:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
return _dispatch(req)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 679, in _dispatch
cmdpats, cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 454, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 733, in _runcommand
return checkargs()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 687, in checkargs
return cmdfunc()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 676, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 385, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 5131, in update
ret = hg.update(repo, rev)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 395, in update
stats = mergemod.update(repo, node, False, False, None)
File "/usr/lib/python2.7/dist-packages/mercurial/merge.py", line 554, in update
stats = applyupdates(repo, action, wc, p2, pa, overwrite)
File "/usr/lib/python2.7/dist-packages/mercurial/merge.py", line 329, in applyupdates
subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), overwrite)
File "/usr/lib/python2.7/dist-packages/mercurial/subrepo.py", line 156, in submerge
mctx.sub(s).get(r)
File "/usr/lib/python2.7/dist-packages/mercurial/subrepo.py", line 668, in get
if self._svnversion >= (1, 5):
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 169, in __get__
result = self.func(obj)
File "/usr/lib/python2.7/dist-packages/mercurial/subrepo.py", line 567, in _svnversion
output, err = self._svncommand(['--version'], filename=None)
File "/usr/lib/python2.7/dist-packages/mercurial/subrepo.py", line 555, in _svncommand
universal_newlines=True, env=env, **extrakw)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1239, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
abort: No such file or directory
I've tried to do rm -rf myrepo and then do hg clone ssh://hg#bitbucket.org/myrepo but that command downloads the repo correctly but I get the same error when hg tries to update the repo to branch default, more specifically I get this:
destination directory: foo
requesting all changes
adding changesets
adding manifests
adding file changes
added 6270 changesets with 20990 changes to 3682 files
updating to branch default
abort: No such file or directory
with trackback, I get an error similar to what I was getting before. I have even tried to re-install mercurial on my system without any luck.
Can you please point to what is the problem. The repo head seems to be alright, (I can clone and update on other machines), and I am able to clone or update other hg repos on my system. Can this have anything to do with subrepos? The trackback suggests it.
My system details: 32-bit Ubuntu 11.10, running mercurial version 1.9.1.
It seems that the source repo has an svn subrepo, and you have no subversion client installed (or svn is not in the search path).
i have a big problem with Mercurial 1.8.2 on Mac OSX 10.6
I used for long time with a lot of projects. Now i haven't used for about 4 weeks. Today i tried and OSX crashed with "hg add" command.
So i googled a little bit and found out, that there was a bug in OSX 10.5 where i have to deactive the SET LOCAL in Terminal Preferences.
I've done so - now
hg add
hg commit -m "message"
works, but when i run
hg push
i get the following error message where i find no information about
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)]
** Mercurial Distributed SCM (version 1.8.2+20110401)
** Extensions loaded:
Traceback (most recent call last):
File "/usr/local/bin/hg", line 38, in <module>
mercurial.dispatch.run()
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 16, in run
sys.exit(dispatch(sys.argv[1:]))
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 36, in dispatch
return _runcatch(u, args)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 58, in _runcatch
return _dispatch(ui, args)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 601, in _dispatch
cmdpats, cmdoptions)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 406, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 655, in _runcommand
return checkargs()
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 609, in checkargs
return cmdfunc()
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 598, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/Library/Python/2.6/site-packages/mercurial/util.py", line 433, in check
return func(*args, **kwargs)
File "/Library/Python/2.6/site-packages/mercurial/commands.py", line 3002, in push
ui.status(_('pushing to %s\n') % url.hidepassword(dest))
File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 75, in __getattribute__
self._load()
File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 47, in _load
mod = _origimport(head, globals, locals)
File "/Library/Python/2.6/site-packages/mercurial/url.py", line 354, in <module>
class httpconnection(keepalive.HTTPConnection):
File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 75, in __getattribute__
self._load()
File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 47, in _load
mod = _origimport(head, globals, locals)
File "/Library/Python/2.6/site-packages/mercurial/keepalive.py", line 361, in <module>
class HTTPResponse(httplib.HTTPResponse):
File "/Library/Python/2.6/site-packages/mercurial/demandimport.py", line 76, in __getattribute__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'HTTPResponse'
Do you have any ideas?
Thanks,
Sascha
I think you should do exactly as said in the error message :
** unknown exception encountered, please report by visiting
** https://www.mercurial-scm.org/wiki/BugTracker