-
-
We should also add an SQLMutation in order to populate existing models with diff_revision to be source_revision. That way, it won't appear blank. You should be able to do something like: SQLMutation('populate_diff_revision', [""" UPDATE diffviewer_filediff SET diff_revision = source_revision WHERE source_revision == '' """]) Might have to test to make sure that works properly (with a dummy database, of course -- I hope you're using that) This also means that you'll need to probably wipe your current dummy database in order to get this evolution to re-apply.
-
To reduce confusion, it'd be helpful to add a help_text=_("...") to this with: "The revision fetch from the repository to generate the side-by-side diff. This may not be the revision of the diff itself if a parent diff is provided."
Fix display of revision if there is a parent diff.
Review Request #2094 — Created Jan. 31, 2011 and discarded
Fix display of revision if there is a parent diff. This is achieved by extending FileDiff by a field 'diff_revision' that stores the revision the user's patch is actually based on.
Post and update diff for hg. Post and update diff for cvs.
BA
- Change Summary:
-
New attempt at a fix, without SQL mutation. - I wonder whether the ugly "add, delete, readd" sequence in evolutions/__init__.py can be simpified. - I did not know how to change the model, so I adapted diffviewer/diffutils.py. This might cause problems in webapi/resources.py.
BA
- Change Summary:
-
Moved the source_revision/diff_revision logic to the model. Unsure whether this is much nicer, though. Once this is accepted I will also update the unit tests. Test result: FAILED (SKIP=7, errors=3) ====================================================================== ERROR: Testing a SFTP-backed bzr repository ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/tests.py", line 264, in test_sftp self._test_ssh(self.bzr_sftp_path, 'README') File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/tests.py", line 68, in _test_ssh tool.check_repository(repo_path) File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/bzr.py", line 221, in check_repository except NotBranchError, e: NameError: global name 'NotBranchError' is not defined ====================================================================== ERROR: Testing a SSH-backed bzr repository ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/tests.py", line 256, in test_ssh self._test_ssh(self.bzr_ssh_path, 'README') File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/tests.py", line 68, in _test_ssh tool.check_repository(repo_path) File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/bzr.py", line 221, in check_repository except NotBranchError, e: NameError: global name 'NotBranchError' is not defined ====================================================================== ERROR: Testing a SSH-backed bzr repository with a LocalSite ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/tests.py", line 260, in test_ssh_with_site self._test_ssh_with_site(self.bzr_ssh_path, 'README') File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/tests.py", line 101, in _test_ssh_with_site lambda: tool.get_file(filename, HEAD)); File "/usr/local/lib64/python2.6/site-packages/Django-1.3-py2.6.egg/django/utils/unittest/case.py", line 474, in assertRaises callableObj(*args, **kwargs) File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/tests.py", line 101, in <lambda> lambda: tool.get_file(filename, HEAD)); File "/home/ballarin/work/reviewboard/reviewboard4/reviewboard/scmtools/bzr.py", line 124, in get_file except BzrError, e: NameError: global name 'BzrError' is not defined ---------------------------------------------------------------------- Ran 444 tests in 408.301s FAILED (SKIP=7, errors=3)