#12966 closed defect (fixed)
Unable to insert changeset 57/XXX and ticket 2 into db: columns repo, changeset, ticket are not unique
Reported by: | Ryan J Ollos | Owned by: | jomae |
---|---|---|---|
Priority: | high | Component: | CodeReviewerPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: |
Description
Discussed in gmessage:trac-users:zFKi53orF4U/QZvynHfGEwAJ, repeated execution of the svn hook results in:
Unable to insert changeset 57/Idouzi_Vote and ticket 2 into db: columns repo, changeset, ticket are not unique
Attachments (2)
Change History (23)
comment:1 Changed 8 years ago by
Owner: | set to Ryan J Ollos |
---|---|
Status: | new → accepted |
comment:2 Changed 7 years ago by
Status: | accepted → new |
---|
comment:3 Changed 7 years ago by
comment:4 Changed 7 years ago by
Priority: | normal → high |
---|---|
Severity: | normal → major |
I think it should give priority to it, its existence does affect me, it makes me very crazy.
comment:5 Changed 7 years ago by
Owner: | Ryan J Ollos deleted |
---|
comment:6 Changed 7 years ago by
When target repository is Git, the same changeset can be added like this:
$ git push origin branch-name # create branch $ git push origin :branch-name # remove branch $ git push origin branch-name # create branch, again
-
codereviewerplugin/1.0/coderev/web_ui.py
diff --git a/codereviewerplugin/1.0/coderev/web_ui.py b/codereviewerplugin/1.0/coderev/web_ui.py index 18e7efda7..abc9e8f72 100644
a b class ChangesetTicketMapper(Component): 339 339 self._map(repos.reponame, changeset) 340 340 341 341 def changeset_modified(self, repos, changeset, old_changeset): 342 self._map(repos.reponame, changeset , update=True)342 self._map(repos.reponame, changeset) 343 343 344 344 # Internal methods 345 345 346 def _map(self, reponame, changeset , update=False):346 def _map(self, reponame, changeset): 347 347 # Extract tickets from changeset message. 348 348 ctu = CommitTicketUpdater(self.env) 349 349 tickets = set(ctu._parse_message(changeset.message)) 350 350 when = to_utimestamp(changeset.date) 351 351 352 352 with self.env.db_transaction as db: 353 if update: 354 db("""DELETE FROM codereviewer_map 355 WHERE repo=%s and changeset=%s 356 """, (reponame or '', changeset.rev)) 353 db("DELETE FROM codereviewer_map WHERE repo=%s and changeset=%s", 354 (reponame or '', changeset.rev)) 357 355 if not tickets: 358 356 tickets = [''] # we still want merges inserted 359 357 for ticket in tickets:
comment:7 Changed 7 years ago by
Did this problem fix it? How do I get updates? I really desperate the solution to this problem.
Changed 7 years ago by
Attachment: | t12966.diff added |
---|
comment:10 Changed 7 years ago by
I am happy to help you test, but you have to tell me how to get the patch and how to install it into an existing system.
comment:11 Changed 7 years ago by
Try the following steps:
$ svn co https://trac-hacks.org/svn/codereviewerplugin/1.0 /tmp/codereviewerplugin-1.0 $ cd /tmp/codereviewerplugin-1.0 $ curl -s https://trac-hacks.org/raw-attachment/ticket/12966/t12966.diff | patch -p3 $ pip install --upgrade --upgrade-strategy=only-if-needed . # if you've installed using pip $ easy_install -ZU . # if you've install using easy_install
comment:12 Changed 7 years ago by
I do not know if the installation was successful because of the following tips.
[root@host105 codereviewerplugin-1.0]# pip install --upgrade --upgrade-strategy=only-if-needed . DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6 Processing /tmp/codereviewerplugin-1.0 Requirement not upgraded as not directly required: Trac in /usr/lib/python2.6/site-packages (from TracCodeReviewer==1.0.0.dev0) Requirement not upgraded as not directly required: setuptools>=0.6 in /usr/lib/python2.6/site-packages (from Trac->TracCodeReviewer==1.0.0.dev0) Requirement not upgraded as not directly required: Genshi>=0.6 in /usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg (from Trac->TracCodeReviewer==1.0.0.dev0) Building wheels for collected packages: TracCodeReviewer Running setup.py bdist_wheel for TracCodeReviewer ... done Stored in directory: /root/.cache/pip/wheels/a1/f3/57/48e704e6769d9e9f035cb04d81965ed3b78fa25e6f04e2aee4 Successfully built TracCodeReviewer Installing collected packages: TracCodeReviewer Successfully installed TracCodeReviewer-1.0.0.dev0 /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning. SNIMissingWarning /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning
Submitted and pushed to the central warehouse, the hook is working properly, everything seems to be no problem, I did not see the error in the Trac log.
Administrator@XSA-20160730LDY MINGW64 /d/git-repositories/testing (0.0.1) $ git push Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 351 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) remote: /usr/lib/python2.6/site-packages/textile/__init__.py:19: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of textile will drop support for Python 2.6 remote: DeprecationWarning To git.idouzi.com:testing 54e830c..d85d31b 0.0.1 -> 0.0.1
But in the end seems to have failed, because I did not see the increase in the comments above the comments, this is a bad news.
comment:14 Changed 7 years ago by
That problem is not related to this issue. I think your hook has any problems. Please report to hook script maintainers with the details and how to reproduce.
comment:15 follow-up: 16 Changed 7 years ago by
I do not think there is a problem, because there is no problem in the trunk, everything is normal, only to switch to the branch to submit, will have this problem. Our team members are having this problem.
comment:16 Changed 7 years ago by
Replying to mx.tian@…:
I do not think there is a problem, because there is no problem in the trunk, everything is normal, only to switch to the branch to submit, will have this problem. Our team members are having this problem.
However, that issue is not the original issue (Unable to insert changeset ...).
comment:17 follow-up: 18 Changed 7 years ago by
I submit the code on the trunk, it works very well.
vim post-update #!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, rename this file to "post-update". REV=$(git rev-parse HEAD) trac-admin /home/projects/idouzi changeset added example $REV exec git update-server-info
Asked here "https://github.com/hvr/trac-git-plugin" can you get the plugin's response?
comment:18 Changed 7 years ago by
Replying to mx.tian@…:
I submit the code on the trunk, it works very well.
vim post-update #!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, rename this file to "post-update". REV=$(git rev-parse HEAD) trac-admin /home/projects/idouzi changeset added example $REV exec git update-server-infoAsked here "https://github.com/hvr/trac-git-plugin" can you get the plugin's response?
As suggested, you should ask on the MailingList.
comment:19 Changed 7 years ago by
Owner: | set to Ryan J Ollos |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In 16868:
comment:20 Changed 7 years ago by
Owner: | changed from Ryan J Ollos to jomae |
---|
comment:21 Changed 7 years ago by
Has this problem been fixed? I am waiting for the end of the repair work, I am very happy to help you test the verification.
See also trac-users:d8uHca633vM/G1cKqkFqAQAJ.