Mercurial Fails to Update to A Revision Due to a File Name - mercurial

I have a repository which I am trying to work on. Unfortunately when I update to a revision of interest it fails with message
abort: Illegal byte sequence: /Users/<user>/Projects/P/infusion16/Standings ? Kattis, Infusion Programming Contest 2016.pdf
When I run update with --traceback and --debug options it shows following:
File "/Users/evgeniy.sharapov/.pyenv/versions/2.7.14/lib/python2.7/site-packages/mercurial/merge.py", line 1381, in batchget
atomictemp=atomictemp)
File "/Users/evgeniy.sharapov/.pyenv/versions/2.7.14/lib/python2.7/site-packages/mercurial/context.py", line 1969, in write
**kwargs)
File "/Users/evgeniy.sharapov/.pyenv/versions/2.7.14/lib/python2.7/site-packages/mercurial/localrepo.py", line 1115, in wwrite
**kwargs)
File "/Users/evgeniy.sharapov/.pyenv/versions/2.7.14/lib/python2.7/site-packages/mercurial/vfs.py", line 87, in write
with self(path, 'wb', backgroundclose=backgroundclose, **kwargs) as fp:
File "/Users/evgeniy.sharapov/.pyenv/versions/2.7.14/lib/python2.7/site-packages/mercurial/vfs.py", line 409, in __call__
fp = util.posixfile(f, mode)
IOError: [Errno 92] Illegal byte sequence: '/Users/<user>/Projects/Puzzles/infusion16/Standings \x96 Kattis, Infusion Programming Contest 2016.pdf'
abort: Illegal byte sequence: /Users/<user>/Projects/Puzzles/infusion16/Standings ? Kattis, Infusion Programming Contest 2016.pdf
Looks like it has some sort of a character that is not supported in a file name ? I check environment both LC_CTYPE and LANG are set to en_US.UTF-8.
What could be done in this situation ? I could probably live without this file or have it renamed? Another problem that the fail in update happens in the middle of the process so I don't have all the files in the work directory.

I'd first run hg man to obtain the relevant PATHNAME, and then extract that file's contents by: hg cat PATHNAME
Then you could try hg revert --all --exclude PATHNAME to extract everything else (assuming all the other filenames are accepted by the host OS).

Related

I am getting attribute Error while running train.py in YOLOV5. Can anyone help me with this?

When I run python train.py --img 640 --batch 4 --epochs 5 --data training/dataset.yaml --cfg training/yolov5l.yaml --weights yolov5l.pt for YOLO V5 in my system I get the following nd why is it:
Traceback (most recent call last):
File "train.py", line 544, in
train(hyp, opt, device, tb_writer)
File "train.py", line 72, in train
wandb_logger = WandbLogger(opt, save_dir.stem, run_id, data_dict)
File "D:\sandra\ai.projects\yolo\yolov5\utils\wandb_logging\wandb_utils.py", line 108, in init
self.data_dict = self.setup_training(opt, data_dict)
File "D:\sandra\ai.projects\yolo\yolov5\utils\wandb_logging\wandb_utils.py", line 139, in setup_training
self.train_artifact_path, self.train_artifact = self.download_dataset_artifact(data_dict.get('train'),
AttributeError: 'str' object has no attribute 'get'
wandb: Waiting for W&B process to finish, PID 22204
wandb: Program failed with code 1.
wandb: Find user logs for this run at: D:\sandra\ai.projects\yolo\yolov5\wandb\offline-run-20210427_130128-jr2z73rr\logs\debug.log
wandb: Find internal logs for this run at: D:\sandra\ai.projects\yolo\yolov5\wandb\offline-run-20210427_130128-jr2z73rr\logs\debug-internal.log
wandb: You can sync this run to the cloud by running:
wandb: wandb sync D:\sandra\ai.projects\yolo\yolov5\wandb\offline-run-20210427_130128-jr2z73rr
Looking at the error traceback, it seems that your dataset configuration file has some missing info, or most likely in the wrong format. The file should contain both training and validation set paths. Here's an example:
train: path/to/train # Notice the spaces
val: path/to/val
...

Compress command fails on fresh installation of WireCloud

I cannot set up a basic wirecloud instance anymore. I tried to create a minimum Wirecloud instance like this:
virtualenv venv
source venv/bin/activate
pip install wirecloud
wirecloud-admin startproject prj
cd prj/
python manage.py collectstatic
python manage.py compress --force
Upon the call to compress the static files an error is thrown:
CommandError: An error occurred during rendering /opt/wc/venv/local/lib/python2.7/site-packages/wirecloud/defaulttheme/templates/wirecloud/views/base_plain.html: Error parsing expression at 30:
none if($important, !important)
^
on line 2 of theme/wirecloud.defaulttheme/css/base/z-depth.scss
Traceback:
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/calculator.py", line 167, in parse_expression
ast = getattr(parser, target)()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 110, in goal
expr_lst = self.expr_lst()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 199, in expr_lst
expr_slst = self.expr_slst()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 211, in expr_slst
or_expr = self.or_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 216, in or_expr
and_expr = self.and_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 225, in and_expr
not_expr = self.not_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 236, in not_expr
comparison = self.comparison()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 244, in comparison
a_expr = self.a_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 275, in a_expr
m_expr = self.m_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 290, in m_expr
u_expr = self.u_expr()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 319, in u_expr
atom = self.atom()
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/grammar/expression.py", line 359, in atom
return TernaryOp(expr_lst)
File "/opt/wc/venv/local/lib/python2.7/site-packages/scss/ast.py", line 558, in __init__
raise SyntaxError("if() must have exactly 3 arguments")
SyntaxError: if() must have exactly 3 arguments
What is the problem here? I just set up the most basic Wirecloud instance possible. If I do not compress it the same error gets thrown in the browser. Is the latest release of wirecloud broken? Or is it something else?
What do I need to do to get a running version again? Help would be much appreciated since the docker image seems to not be able to get restarted and configurations like other databases and so on are thus not very easy to set up...
Use the just released version 0.9.2 of WireCloud :)
See this github ticket for more details.
We are also updated the docker images but if you continue have problems using it, please create a Github ticket or create a new question on StackOverflow with the details.
Wirecloud seems to not be ready for pyscss version 1.3.5.
A downgrade via ´pip install -I pyscss==1.3.4` will do the trick.

Tryton ERP MySQL installation

I'm trying to install Tryton ERP with MySQL as the database. It's not quite clear what you are meant to do.
From the config documentation you simply supply the uri to the database under the [database] section:
[database]
uri = mysql://user:pass#localhost:3306
However running trytond -v -c /home/user/.config/tryton/3.8/tryton.conf does not seem to get it working. When trying to access the 127.0.0.1:8050 where I've got Tryton running, I simply get 127.0.0.1 - - [23/Nov/2015 16:55:10] code 404, message File not found
One would assume, Tryton either installs the database on its own or you need to create yourself somehow but I didn't see any documentation surrounding that.
I've also trying adding a database through the Tryton GUI, it encounters the following error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tryton/gui/window/dbcreate.py", line 65, in server_change
common.refresh_langlist(self.combo_language, host, port)
File "/usr/local/lib/python2.7/dist-packages/tryton/common/common.py", line 253, in refresh_langlist
lang_list = rpc.db_exec(host, port, 'list_lang')
File "/usr/local/lib/python2.7/dist-packages/tryton/rpc.py", line 57, in db_exec
result = getattr(connection.common.db, method)(None, None, *args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python2.7/dist-packages/tryton/jsonrpc.py", line 271, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response
return u.close()
File "/usr/local/lib/python2.7/dist-packages/tryton/jsonrpc.py", line 134, in close
return json.loads(self.data, object_hook=object_hook)
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 505, in loads
return cls(encoding=encoding, **kw).decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 389, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
JSONDecodeError: Expecting value: line 1 column 2 (char 1)
I've got the prerequisites installed that were listed here and MySQL-python package installed, should there be anything else?
You should create a database on MySQL with it's own tools. Once the database is created you must initialize it using the following command:
trytond -c <config_file> -d <database name> --all
See for complete reference:
http://doc.tryton.org/3.8/trytond/doc/topics/setup_database.html#topics-setup-database.
Once finished, the server will ask for an admin password. Once entered you can conect using the tryton client with the admin user and the entered password.
In order to access tryton from web client you must install and configure the sao web interface, that can be found on:
https://www.npmjs.com/package/tryton-sao

Mercurial https clone: "abort: error: (...) wrong version number"

I have problem with mercurial on OS X 10.9.1
I have a repository on bitbucket with couple files, when I'm trying to clone it I'm getting an error:
mac-mini-jakub:testrepo kubeczek$ hg clone https://kubecz3k#bitbucket.org/kubecz3k/test
abort: error: _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
I have installed Mercurial 2.8.2 for MacOS X 10.9 from https://www.mercurial-scm.org/downloads/
I'm pretty sure that on the side of the bitbucket everything is ok, because I have no problem on linux machine.
here is the full traceback:
mac-mini-jakub:testrepo kubeczek$ hg clone https://kubecz3k#bitbucket.org/kubecz3k/test --traceback
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 133, in _runcatch
return _dispatch(req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 806, in _dispatch
cmdpats, cmdoptions)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 585, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 897, in _runcommand
return checkargs()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 868, in checkargs
return cmdfunc()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 803, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 512, in check
return func(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/commands.py", line 1286, in clone
branch=opts.get('branch'))
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 268, in clone
srcpeer = peer(ui, peeropts, source)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 122, in peer
return _peerorrepo(rui, path, create).peer()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 102, in _peerorrepo
obj = _peerlookup(path).instance(ui, path, create)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 238, in instance
inst._fetchcaps()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 57, in _fetchcaps
self.caps = set(self._call('capabilities').split())
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 171, in _call
fp = self._callstream(cmd, **args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 118, in _callstream
resp = self.urlopener.open(req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/url.py", line 368, in https_open
return self.do_open(self._makeconnection, req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/keepalive.py", line 257, in do_open
raise urllib2.URLError(err)
URLError: <urlopen error [Errno 1] _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number>
abort: error: _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
My Python version is:
mac-mini-jakub:~ kubeczek$ python -V
Python 2.7.6
And SSL:
>>> print _ssl.OPENSSL_VERSION
OpenSSL 0.9.8y 5 Feb 2013
I will appreciate every help, thanks!
You probably have to disable TLS, read this
To do so, add this to ~/.hgrc
[ui]
tls = False
more information about SSL and TLS here
There is another cause. It might not have been your problem, but it should be listed here as well, for the case others encounter this problem:
If you are behind a proxy and your proxy settings are incorrect, this error message appears as well. God knows why...
Example: you have the following config
[http_proxy]
no = localhost,127.0.0.1
host = 1.2.3.4:8080
user = myusername
passwd = oldpassword
The oldpassword might be obsolet (you have forgotten to change it). Then the very same SSL wrong version error appears. It does absolutly make no sense at all (at least to me), but I reproduced this issue with mercurial 3.6.2. Correcting the proxy settings fixes everything.
Not exactly a direct solution but good workaround:
With strong suggestion that the problem lies is ssl I have switched to ssh(https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678) and now everything works. So from a practical point of view for me this problem is solved.
I had this problem for some bitbucket repositories (but not all). I found that, as per the traceback, setting --config ui.clonebundles=false worked.
hg clone --config ui.clonebundles=false https://bitbucket.org/me/myrepo
made the clone much slower mind you.
[edit] -- Although, see my comment on #UniversE's answer above, the actual problem was to do with an atlassian subdomain not being on my squid proxy's whitelist. phew, that was hard to debug.
As one of the question's comments suggested, switching from https to ssh fixed it for me
You have to disable clonebundle from system wide mercurial config file or own config file.
To do, add following lines to /etc/mercurial/hgrc or ~/.hgrc
# system-wide mercurial configuration file
# See hgrc(5) for more information
[ui]
clonebundles = False

How to resolve mercurial conflict where no match is found?

I have managed to really get my repo into a state, and I don't have the mad skills required to fix it, your help would be appreciated.
I am trying to merge/update so that the work I developed in a seperate branch is correctly integrated into my local one.
When I run and run a merge on rev 284, I get the following error:
% hg --repository C:\Projects\foo merge --verbose
--tool=internal:merge 284 abort: data/Web/Utilities/Extensions/RegexExtensions.cs.i#364e78cf7bcb: no
match found! [command returned code 255 Sat Jan 19 16:12:54 2013]
I am using tortoisehg, and have tried to search for a resolution but I can't figure out how to resolve this error?
What has happend in this case, is that the file has been deleted in one branch, and I guess exists in the other?
How to resovle?
.
Edit 1:
Was fiddling around and found this as well:
#!python
** Mercurial version (2.4.2). TortoiseHg version (2.6.2)
** Command: --nofork workbench
** CWD: C:\Projects\foo
** Encoding: cp1252
** Extensions loaded:
** Python version: 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
** Windows version: sys.getwindowsversion(major=6, minor=1, build=7600, platform=2, service_pack='')
** Processor architecture: x64
** Qt-4.8.0 PyQt-4.9.1
Traceback (most recent call last):
File "tortoisehg\hgqt\repowidget.pyo", line 1678, in visualDiffToLocal
File "tortoisehg\hgqt\visdiff.pyo", line 213, in visualdiff
File "mercurial\copies.pyo", line 166, in pathcopies
File "mercurial\copies.pyo", line 151, in _backwardcopies
File "mercurial\copies.pyo", line 138, in _forwardcopies
File "mercurial\copies.pyo", line 106, in _tracefile
File "mercurial\context.pyo", line 722, in ancestors
File "mercurial\context.pyo", line 546, in parents
File "mercurial\util.pyo", line 246, in __get__
File "mercurial\context.pyo", line 399, in _filenode
File "mercurial\revlog.pyo", line 776, in lookup
LookupError: data/web/Utilities/Extensions/RegexExtensions.cs.i#364e78cf7bcb: no match found
Edit 2:
I've managed to merge most of the revisions I need, I am left now with just one on the branch that is corrupt.
How can I now discard that revision/branch?
CLI-version of merge (screenshots - maybe later)
hg up
hg merge 297
hg commit -m "Merge 1"
hg merge 284
hg commit -m "Merge 2"
If you want to merge at some other points: fix destination of update (to this point you'll merge) and merge sources