500 errors after updating local_settings.py - deployment

I'm deploying Kiwi for the first time and I'm coming up against some issues. The standard deployment works fine: I can run the docker, log in, etc.
Once I tried configuring the deployment, though, I've run into a lot of problems.
If I try to disable the Internal Bug Tracker, I get the following error when trying to launch any page in the site:
web_1 | [Thu Feb 06 16:23:32.612335 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] mod_wsgi (pid=11): Failed to exec Python script file '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1 | [Thu Feb 06 16:23:32.612409 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] mod_wsgi (pid=11): Exception occurred processing WSGI script '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1 | [Thu Feb 06 16:23:32.613673 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] Traceback (most recent call last):
web_1 | [Thu Feb 06 16:23:32.613895 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] File "/venv/lib64/python3.6/site-packages/tcms/wsgi.py", line 40, in <module>
web_1 | [Thu Feb 06 16:23:32.613913 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] _APPLICATION = get_wsgi_application()
web_1 | [Thu Feb 06 16:23:32.613922 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] File "/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
web_1 | [Thu Feb 06 16:23:32.613925 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] django.setup(set_prefix=False)
web_1 | [Thu Feb 06 16:23:32.613930 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] File "/venv/lib64/python3.6/site-packages/django/__init__.py", line 24, in setup
web_1 | [Thu Feb 06 16:23:32.613933 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] apps.populate(settings.INSTALLED_APPS)
web_1 | [Thu Feb 06 16:23:32.613938 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] File "/venv/lib64/python3.6/site-packages/django/apps/registry.py", line 91, in populate
web_1 | [Thu Feb 06 16:23:32.613941 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] app_config = AppConfig.create(entry)
web_1 | [Thu Feb 06 16:23:32.613945 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] File "/venv/lib64/python3.6/site-packages/django/apps/config.py", line 90, in create
web_1 | [Thu Feb 06 16:23:32.614502 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] module = import_module(entry)
web_1 | [Thu Feb 06 16:23:32.614532 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] File "/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
web_1 | [Thu Feb 06 16:23:32.614537 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] return _bootstrap._gcd_import(name[level:], package, level)
web_1 | [Thu Feb 06 16:23:32.614543 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
web_1 | [Thu Feb 06 16:23:32.614548 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
web_1 | [Thu Feb 06 16:23:32.614818 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
web_1 | [Thu Feb 06 16:23:32.614843 2020] [wsgi:error] [pid 11:tid 140443152291584] [remote 192.168.105.200:52787] ModuleNotFoundError: No module named 'colorfield'
web_1 | 192.168.105.200 - - [06/Feb/2020:16:23:31 +0000] "GET / HTTP/1.1" 500 527 "https://192.168.105.25/accounts/login/?next=/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
web_1 | [Thu Feb 06 16:24:00.126930 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] mod_wsgi (pid=11): Failed to exec Python script file '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1 | [Thu Feb 06 16:24:00.127061 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] mod_wsgi (pid=11): Exception occurred processing WSGI script '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1 | [Thu Feb 06 16:24:00.127397 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] Traceback (most recent call last):
web_1 | [Thu Feb 06 16:24:00.127491 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] File "/venv/lib64/python3.6/site-packages/tcms/wsgi.py", line 40, in <module>
web_1 | [Thu Feb 06 16:24:00.127501 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] _APPLICATION = get_wsgi_application()
web_1 | [Thu Feb 06 16:24:00.127514 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] File "/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
web_1 | [Thu Feb 06 16:24:00.127519 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] django.setup(set_prefix=False)
web_1 | [Thu Feb 06 16:24:00.127529 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] File "/venv/lib64/python3.6/site-packages/django/__init__.py", line 24, in setup
web_1 | [Thu Feb 06 16:24:00.127534 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] apps.populate(settings.INSTALLED_APPS)
web_1 | [Thu Feb 06 16:24:00.127543 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] File "/venv/lib64/python3.6/site-packages/django/apps/registry.py", line 83, in populate
web_1 | [Thu Feb 06 16:24:00.127548 2020] [wsgi:error] [pid 11:tid 140443034793728] [remote 192.168.105.200:52792] raise RuntimeError("populate() isn't reentrant")
Trying to remove the Bug entries in the menus threw a completely different error (didn't keep a copy of the log).
As far as I can tell the Debug option has never worked, I don't get the detailed 500 errors on the browser.
I got a little bit desperate and pasted the whole common file into local_settings.py to see if there was something I was doing wrong and got the following error:
web_1 | [Thu Feb 06 16:44:45.990672 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] mod_wsgi (pid=10): Failed to exec Python script file '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1 | [Thu Feb 06 16:44:45.990740 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] mod_wsgi (pid=10): Exception occurred processing WSGI script '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1 | [Thu Feb 06 16:44:45.991753 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] Traceback (most recent call last):
web_1 | [Thu Feb 06 16:44:45.991853 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "/venv/lib64/python3.6/site-packages/tcms/wsgi.py", line 40, in <module>
web_1 | [Thu Feb 06 16:44:45.991863 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] _APPLICATION = get_wsgi_application()
web_1 | [Thu Feb 06 16:44:45.991872 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
web_1 | [Thu Feb 06 16:44:45.991877 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] django.setup(set_prefix=False)
web_1 | [Thu Feb 06 16:44:45.991883 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "/venv/lib64/python3.6/site-packages/django/__init__.py", line 19, in setup
web_1 | [Thu Feb 06 16:44:45.991904 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
web_1 | [Thu Feb 06 16:44:45.991917 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 76, in __getattr__
web_1 | [Thu Feb 06 16:44:45.991933 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] self._setup(name)
web_1 | [Thu Feb 06 16:44:45.991942 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 63, in _setup
web_1 | [Thu Feb 06 16:44:45.991946 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] self._wrapped = Settings(settings_module)
web_1 | [Thu Feb 06 16:44:45.991952 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 142, in __init__
web_1 | [Thu Feb 06 16:44:45.991954 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] mod = importlib.import_module(self.SETTINGS_MODULE)
web_1 | [Thu Feb 06 16:44:45.991959 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
web_1 | [Thu Feb 06 16:44:45.991964 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] return _bootstrap._gcd_import(name[level:], package, level)
web_1 | [Thu Feb 06 16:44:45.991969 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
web_1 | [Thu Feb 06 16:44:45.991977 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
web_1 | [Thu Feb 06 16:44:45.991982 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
web_1 | [Thu Feb 06 16:44:45.991990 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
web_1 | [Thu Feb 06 16:44:45.992008 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "<frozen importlib._bootstrap_external>", line 678, in exec_module
web_1 | [Thu Feb 06 16:44:45.992015 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
web_1 | [Thu Feb 06 16:44:45.992037 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "/venv/lib64/python3.6/site-packages/tcms/settings/product.py", line 13, in <module>
web_1 | [Thu Feb 06 16:44:45.992041 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] from .local_settings import * # noqa: F401,F403
web_1 | [Thu Feb 06 16:44:45.992047 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] File "/venv/lib64/python3.6/site-packages/tcms/settings/local_settings.py", line 35, in <module>
web_1 | [Thu Feb 06 16:44:45.992051 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] for plugin in pkg_resources.iter_entry_points('kiwitcms.plugins'):
web_1 | [Thu Feb 06 16:44:45.992070 2020] [wsgi:error] [pid 10:tid 139924213229312] [remote 192.168.105.200:53696] NameError: name 'pkg_resources' is not defined
web_1 | 192.168.105.200 - - [06/Feb/2020:16:44:45 +0000] "GET / HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
web_1 | [Thu Feb 06 16:44:59.226706 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] mod_wsgi (pid=10): Failed to exec Python script file '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1 | [Thu Feb 06 16:44:59.226766 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] mod_wsgi (pid=10): Exception occurred processing WSGI script '/venv/lib64/python3.6/site-packages/tcms/wsgi.py'.
web_1 | [Thu Feb 06 16:44:59.226974 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] Traceback (most recent call last):
web_1 | [Thu Feb 06 16:44:59.227041 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "/venv/lib64/python3.6/site-packages/tcms/wsgi.py", line 40, in <module>
web_1 | [Thu Feb 06 16:44:59.227047 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] _APPLICATION = get_wsgi_application()
web_1 | [Thu Feb 06 16:44:59.227053 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
web_1 | [Thu Feb 06 16:44:59.227056 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] django.setup(set_prefix=False)
web_1 | [Thu Feb 06 16:44:59.227061 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "/venv/lib64/python3.6/site-packages/django/__init__.py", line 19, in setup
web_1 | [Thu Feb 06 16:44:59.227064 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
web_1 | [Thu Feb 06 16:44:59.227069 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 76, in __getattr__
web_1 | [Thu Feb 06 16:44:59.227072 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] self._setup(name)
web_1 | [Thu Feb 06 16:44:59.227077 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 63, in _setup
web_1 | [Thu Feb 06 16:44:59.227079 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] self._wrapped = Settings(settings_module)
web_1 | [Thu Feb 06 16:44:59.227084 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 142, in __init__
web_1 | [Thu Feb 06 16:44:59.227087 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] mod = importlib.import_module(self.SETTINGS_MODULE)
web_1 | [Thu Feb 06 16:44:59.227092 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
web_1 | [Thu Feb 06 16:44:59.227094 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] return _bootstrap._gcd_import(name[level:], package, level)
web_1 | [Thu Feb 06 16:44:59.227099 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
web_1 | [Thu Feb 06 16:44:59.227104 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
web_1 | [Thu Feb 06 16:44:59.227109 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
web_1 | [Thu Feb 06 16:44:59.227114 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
web_1 | [Thu Feb 06 16:44:59.227119 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "<frozen importlib._bootstrap_external>", line 678, in exec_module
web_1 | [Thu Feb 06 16:44:59.227124 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
web_1 | [Thu Feb 06 16:44:59.227133 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "/venv/lib64/python3.6/site-packages/tcms/settings/product.py", line 13, in <module>
web_1 | [Thu Feb 06 16:44:59.227136 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] from .local_settings import * # noqa: F401,F403
web_1 | [Thu Feb 06 16:44:59.227142 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] File "/venv/lib64/python3.6/site-packages/tcms/settings/local_settings.py", line 35, in <module>
web_1 | [Thu Feb 06 16:44:59.227144 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] for plugin in pkg_resources.iter_entry_points('kiwitcms.plugins'):
web_1 | [Thu Feb 06 16:44:59.227159 2020] [wsgi:error] [pid 10:tid 139924204836608] [remote 192.168.105.200:53698] NameError: name 'pkg_resources' is not defined
web_1 | 192.168.105.200 - - [06/Feb/2020:16:44:59 +0000] "GET / HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"
Is this a problem with my settings?
Thanks,
Carlos

ModuleNotFoundError: No module named 'colorfield'
colorfield is a new dependency that just got added couple of days ago. This means you are using the latest master branch, not a released version of Kiwi TCMS. It also means this particular dependency isn't installed in your docker image probably.
Without further information as to which docker image are you using and how exactly are you starting it and what exactly is in your local_settings.py there's little we can do to help you.

Related

Finding the end date from asynchronous starting but consecutive running date ranges

I need to help with a database model and and efficient calculation method of the last end date.
The ranges have a start date but will wait to start until the currently active ranges have ended. Changing the length or start of one range should cascade to the waiting ranges and push them back. But they can never start before their start date.
The database mock here is just to explain the problem and doesn't need to be followed as long as it works properly.
| id | start | length | 01 02 03 04 05 06 07 08 09 10 11 12 |
| 1 | 03 | 2 | ------ |
| 2 | 06 | 2 | ------ |
I am aware that I can brute force the answer to get the last date. But I'm looking for a more efficient solution as there are many ranges and the end date needs to read often.
Also is this something that's possible to calculate in a PostgreSQL query? Or maybe keep end date fields up to date with triggers?
Examples
Here range 2 starts on 04 but can't be used until after range 1 finishes.
| id | start | length | 01 02 03 04 05 06 07 08 09 10 11 12 |
| 1 | 02 | 5 | ------------------ |
| 2 | 04 | 5 | ------------------ |
If we update the range 1, range 2 should move up with it.
| id | start | length | 01 02 03 04 05 06 07 08 09 10 11 12 |
| 1 | 02 | 4 | -------------- |
| 2 | 04 | 5 | ------------------ |
But range 2 shouldn't move past its start date.
| id | start | length | 01 02 03 04 05 06 07 08 09 10 11 12 |
| 1 | 02 | 1 | -- |
| 2 | 04 | 5 | ------------------ |
If you just take the latest start date and add its duration you will get the wrong answer.
| id | start | length | 01 02 03 04 05 06 07 08 09 10 11 12 |
| 1 | 04 | 5 | ------------------ |
| 2 | 05 | 2 | ------ |
Get: 7
Expected: 10

File size is double while replacing value in variable and output with a different name

When replacing a value from a base text, and outputting the file, the file size double, rather than 4kb to 8kb.
$t=3
$F=30
Do{
$t = $t+1
$F=$F+10
$y = (Get-Content -Path D:\test.php).Replace("YU9","$F")
$y | Out-File D:\Test\delivery$t.php -Force
}
until($t -eq 50)
Right, powershell 5.1 out-file defaults to utf16 or unicode, so it's twice as big as ascii or utf8. Unicode has nulls inbetween each letter. The first two bytes are the BOM. "0D 0A" is carriage return and linefeed.
'abcde' | set-content file
'abcde' | out-file file2
format-hex file
Path: C:\Users\js\foo\file
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000 61 62 63 64 65 0D 0A abcde..
format-hex file2
Path: C:\Users\js\foo\file2
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000 FF FE 61 00 62 00 63 00 64 00 65 00 0D 00 0A 00 .þa.b.c.d.e.....

changing number of different columns on notepad++

example text like this :
abcde abcde abcde 01 abcde abcde abcde 01
efghi efghi efghiefghiefghi 01 efghiefghiefghiefghi 01
jklmnjklmn jklmnjklmnjklmnjklmn 01 jklmnjklmnjklmnjklmn 01
abcde abcde abcde 01 abcde abcde abcde 01
efghi efghi efghiefghiefghi 01 efghiefghiefghiefghi 01
jklmnjklmn jklmnjklmnjklmnjklmn 01 jklmnjklmnjklmnjklmn 01
abcde abcde abcde 01 abcde abcde abcde 01
efghi efghi efghiefghiefghi 01 efghiefghiefghiefghi 01
jklmnjklmn jklmnjklmnjklmnjklmn 01 jklmnjklmnjklmnjklmn 01
...
...`
and i need to be like this :
abcde abcde abcde 01 abcde abcde abcde 01
efghi efghi efghiefghiefghi 01 efghiefghiefghiefghi 01
jklmnjklmn jklmnjklmnjklmnjklmn 01 jklmnjklmnjklmnjklmn 01
abcde abcde abcde 02 abcde abcde abcde 02
efghi efghi efghiefghiefghi 02 efghiefghiefghiefghi 02
jklmnjklmn jklmnjklmnjklmnjklmn 02 jklmnjklmnjklmnjklmn 02
abcde abcde abcde 03 abcde abcde abcde 03
efghi efghi efghiefghiefghi 03 efghiefghiefghiefghi 03
jklmnjklmn jklmnjklmnjklmnjklmn 03 jklmnjklmnjklmnjklmn 03
...
...`
i want just change the numbers of each lines
what i try so far is make the number on same column like this :
abcde abcde abcde ##########01 abcde abcde abcde #01
efghi efghi efghiefghiefghi #####01 efghiefghiefghiefghi #01
jklmnjklmn jklmnjklmnjklmnjklmn 01 jklmnjklmnjklmnjklmn 01
abcde abcde abcde ##########01 abcde abcde abcde #01
efghi efghi efghiefghiefghi #####01 efghiefghiefghiefghi #01
jklmnjklmn jklmnjklmnjklmnjklmn 01 jklmnjklmnjklmnjklmn 01
abcde abcde abcde ##########01 abcde abcde abcde #01
efghi efghi efghiefghiefghi #####01 efghiefghiefghiefghi #01
jklmnjklmn jklmnjklmnjklmnjklmn 01 jklmnjklmnjklmnjklmn 01
then i use column editor>number to insert to change the numbers
abcde abcde abcde ##########01 abcde abcde abcde #01
efghi efghi efghiefghiefghi #####01 efghiefghiefghiefghi #01
jklmnjklmn jklmnjklmnjklmnjklmn 01 jklmnjklmnjklmnjklmn 01
abcde abcde abcde ##########02 abcde abcde abcde #02
efghi efghi efghiefghiefghi #####02 efghiefghiefghiefghi #02
jklmnjklmn jklmnjklmnjklmnjklmn 02 jklmnjklmnjklmnjklmn 02
abcde abcde abcde ##########03 abcde abcde abcde #03
efghi efghi efghiefghiefghi #####03 efghiefghiefghiefghi #03
jklmnjklmn jklmnjklmnjklmnjklmn 03 jklmnjklmnjklmnjklmn 03
the i delete the hashtags using find and replace.
so, just change the numbers. is there a way to make it faster?

Add all timestamp data according to date

I have this access_log table
create_time | time_spent
--------------+------------
NOV 02, 2017 | 00:00:00
NOV 02, 2017 | 01:45:04
NOV 02, 2017 | 00:00:00
NOV 02, 2017 | 00:00:00
NOV 02, 2017 | 00:39:29
NOV 02, 2017 | 03:05:49
NOV 03, 2017 | 03:58:57
NOV 03, 2017 | 00:52:29
NOV 03, 2017 | 02:53:25
using this table, make looks like this using PostgreSQL. it should add all time_spent column data of respective date
create_time | time_spent
--------------+------------
NOV 02, 2017 | 05:30:22
NOV 03, 2017 | 07:44:51
Thank you in advance.
a simple group by here:
t=# create table access_log (create_time date,time_spent time);
CREATE TABLE
t=# copy access_log from stdin delimiter '|';
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself, or an EOF signal.
>> NOV 02, 2017 | 00:00:00
NOV 02, 2017 | 01:45:04
NOV 02, 2017 | 00:00:00
NOV 02, 2017 | 00:00:00
NOV 02, 2017 | 00:39:29
NOV 02, 2017 | 03:05:49
NOV 03, 2017 | 03:58:57
NOV 03, 2017 | 00:52:29
NOV 03, 2017 | 02:53:25>> >> >> >> >> >> >> >>
>> \.
t=# select sum(time_spent), create_time from access_log group by create_time;
sum | create_time
----------+-------------
05:30:22 | 2017-11-02
07:44:51 | 2017-11-03
(2 rows)

Why did my branches completely merge?

I'm new to mercurial. I try to work on 2 versions of my software. I have named 2 branches : one is "v8" (old/stable) other is "default".
I thought I understood things but now I seem to have merged both versions.
This is what it looks like (removed info from before branch) :
o changeset: 39:1e72986020bd
| tag: tip
| parent: 37:406b8e897030
| user: ME <me#example.com>
| date: Thu Jan 16 09:53:55 2014 +0100
| summary: Suppression des DCU
|
| o changeset: 38:7381e3f2309b
|/| branch: v8
| | parent: 31:611a4416e4a5
| | parent: 37:406b8e897030
| | user: ME <me#example.com>
| | date: Wed Jan 15 19:21:58 2014 +0100
| | summary: fixforbrowser sur impressiondecomptes
| |
o | changeset: 37:406b8e897030
| | user: ME <me#example.com>
| | date: Wed Jan 15 19:02:18 2014 +0100
| | summary: fixforbrowser sur impressiondecomptes
| |
o | changeset: 36:d7c0feaad38a
| | user: ME <me#example.com>
| | date: Wed Jan 15 18:57:44 2014 +0100
| | summary: Cosmétique
| |
o | changeset: 35:d2b4c3130b61
| | user: ME <me#example.com>
| | date: Sun Jan 12 14:38:36 2014 +0100
| | summary: Cosmétique encore
| |
o | changeset: 34:5447f904a336
| | user: ME <me#example.com>
| | date: Fri Jan 10 03:51:33 2014 +0100
| | summary: projet
| |
o | changeset: 33:f48c4023d822
| | user: ME <me#example.com>
| | date: Fri Jan 10 03:50:06 2014 +0100
| | summary: cosmétique (beaucoup de fiches)
| |
o | changeset: 32:cc6b2de08004
| | parent: 30:5b4bef6aad09
| | user: ME <me#example.com>
| | date: Fri Jan 10 02:12:59 2014 +0100
| | summary: cosmétique
| |
| # changeset: 31:611a4416e4a5
| | branch: v8
| | parent: 29:0c47053f9a7b
| | user: ME <me#example.com>
| | date: Fri Jan 10 02:11:01 2014 +0100
| | summary: purge deleted ?
| |
o | changeset: 30:5b4bef6aad09
|\| parent: 25:74d793961989
| | parent: 29:0c47053f9a7b
| | user: ME <me#example.com>
| | date: Fri Jan 10 02:09:04 2014 +0100
| | summary: v9 after fixes
| |
| o changeset: 29:0c47053f9a7b
| | branch: v8
| | parent: 27:79855eedf019
| | user: ME <me#example.com>
| | date: Fri Jan 10 01:57:22 2014 +0100
| | summary: 8.084 ok?
| |
+---o changeset: 28:e60a7447adf4
| |/ branch: v8
| | parent: 25:74d793961989
| | parent: 27:79855eedf019
| | user: ME <me#example.com>
| | date: Fri Jan 10 01:41:05 2014 +0100
| | summary: 8.084 ??
| |
| o changeset: 27:79855eedf019
| | branch: v8
| | user: ME <me#example.com>
| | date: Wed Jan 08 16:57:12 2014 +0100
| | summary: fix detection des fichiers de récap sur imports feuillets
| |
| o changeset: 26:19d2f4b2d867
| | branch: v8
| | parent: 23:14219f06bc1d
| | user: ME <me#example.com>
| | date: Wed Jan 08 16:49:35 2014 +0100
| | summary: fix qpdep et qpdrm sur imports feuillets
| |
o | changeset: 25:74d793961989
| | user: ME <me#example.com>
| | date: Wed Jan 08 16:44:30 2014 +0100
| | summary: premieres modifs v9
| |
o | changeset: 24:1af3020ba120
| | parent: 22:7307bc3e87ba
| | user: ME <me#example.com>
| | date: Thu Dec 26 15:47:20 2013 +0100
| | summary: Initial v9
| |
| o changeset: 23:14219f06bc1d
|/ branch: v8
| user: ME <me#example.com>
| date: Thu Dec 26 15:41:55 2013 +0100
| summary: Branche stable v8
|
o changeset: 22:7307bc3e87ba
| user: ME <me#example.com>
| date: Fri Dec 20 18:50:50 2013 +0100
| summary: 8.083
Rev 31 seems to be the last "good" v8
then I did hg update default and worked on "default" branch.
I committed up to rev 36 because I knew I had to make a fix I would want to merge with stable/v8
I did the change, committed (rev 37)
then I switched to v8 with hg update v8
then I tried to merge the change from default with hg merge 406b8e897030
then I committed (rev 38)
I did a last commit after removing 3 binary (DCU) files that were in one of the repository although *.dcu are .hgignored.
Now, when I switch branches, I see no file change. I can go back to rev 31 with hg update v8 (probably useless) and hg update --rev 31 but I would like :
to understand what I did wrong
to get 2 clean branches back
If you know of a clear explanation of how branches and merge work, I'd love to read it.
Branches stores diverged history of changes in sources (of anything)
Merging branches brings to target branch fro source branch all changes, appeared from latest divergence point: it can be branchpoint or latest mergeset's parent
If you have to port only subset of changes from branch to branch (1+ changeset, but < ALL), you have to hg graft only these changesets