SVN: added SVN Log dialog
ClosedPublic

Authored by nikolaik on Mar 17 2020, 3:47 PM.

Details

Summary

Added SVN Log dialog. Dialog looks and behaves similar to a TortoiseSVN one.
Dialog supports:

  • update repo to specified revision;
  • revert repo to specified revision;
  • revert file to a specified revision;
  • show changes against previois commit;
  • show changes against working copy.

Everything is done by the context menu.

Test Plan

Run SVN Log dialog and check update works, revert works, revert file works, show changes and show changes against working copy works.

Diff Detail

Repository
R449 Plugins for Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nikolaik requested review of this revision.Mar 17 2020, 3:47 PM
nikolaik created this revision.

Another huge one guys, sorry.
SVN Log missing in current SVN pluging but this is one of the most important features (and one of the most required in my everyday needs).
I am ready for comments and updates.

SVN log is parsed via 'svn log --verbose --xml' because it contatins the most complete log information.

anthonyfieroni added a subscriber: anthonyfieroni.EditedMar 17 2020, 6:39 PM

Dialog looks and behaves similar to a TortoiseSVN one.

Don't make dialogs to looks like 3-th party software, we have log in git, you can make like that, also it pretty simple.

Thanks in advance for fixing these typos and removing the executable bit from the source file permissions.

svn/svncommands.cpp
323

Typo: enougth -> enough

svn/svncommands.h
144

Typo: direcotry -> directory

nikolaik updated this revision to Diff 77863.Mar 17 2020, 8:07 PM

Thanks for comments!
Update in response to review comments: fixed typos, removed executable bit from the source file permissions.

nikolaik marked 2 inline comments as done.Mar 17 2020, 8:08 PM
nikolaik added a comment.EditedMar 17 2020, 8:24 PM

Dialog looks and behaves similar to a TortoiseSVN one.

Don't make dialogs to looks like 3-th party software, we have log in git, you can make like that, also it pretty simple.

Thanks for response.
First of all, being similar to something good is not that bad. But again this is only "looks and behaves similar", this is not a "copy-paste".
Second of all, this dialog contains only features i (and in my opinion most users) use daily. This is also a 'git log' problem: its not enough for me and pushes me to use several tools.

Anyway i'm ready for updates.

elvisangelaccio requested changes to this revision.Mar 17 2020, 10:47 PM

From a quick look it seems there is a lot of refactored code, this could be done separately in another commit, right?

That said, the UI looks good to me. I feel it's a bit slow though, maybe 100 is too much as log length? I suppose parsing the XML is not cheap.

svn/CMakeLists.txt
11–20

No need to introduce a new variable, just use fileviewsvnplugin_SRCS.

svn/fileviewsvnplugin.cpp
63

Please use nullptr instead.

122–123

Please use the new connection style.

svn/svncommands.h
38–39

Please use camelCase.

This revision now requires changes to proceed.Mar 17 2020, 10:47 PM
nikolaik updated this revision to Diff 77891.Mar 18 2020, 9:57 AM

Update in response to comments: fixed CMakeLists.txt and other code problems.

nikolaik marked 3 inline comments as done.Mar 18 2020, 9:57 AM

From a quick look it seems there is a lot of refactored code, this could be done separately in another commit, right?

This is mostly a new code. For better understanding i think we can separate it:

  1. commit with SvnCommands: all new additions.
  2. commit with FileViewSvnPlugin: all new funcionality (except log dialog call).
  3. add SvnLogDialog.

It there a way we can introduce this to the upcoming 20.04LTS? How much time do we have?

That said, the UI looks good to me. I feel it's a bit slow though, maybe 100 is too much as log length? I suppose parsing the XML is not cheap.

For my remote repo with "time svn log - l 100..." it takes around 2.3sec for xml and 2.0sec without xml (this average for a five measures).
Parsing xml itself takes around 0.1sec in the debug build.
As you can see svn log itself is slow. Both 2.3sec and 1.8sec is unacceptable. We need to think about caching log entries (like TortoiseSVN does), this is a big deal and maybe we should do it later. From all of the above it follows I suggest to use this code with possible future upgrades.
What do you say about 50 for log length? It tooks around 0.3sec xml and 0.25sec without xml for me.

nikolaik updated this revision to Diff 77894.Mar 18 2020, 10:31 AM

SVNCommands -> SvnCommands

If you really would like this feature in 20.04, we have until 23.59 of tomorrow (March 19).

I'd say let's not split it then, it will be quicker to review (I'll do it now).

elvisangelaccio requested changes to this revision.Mar 18 2020, 10:08 PM
elvisangelaccio added inline comments.
svn/fileviewsvnplugin.cpp
57–62

Unrelated changes, I only mean to use nullptr for the new code. The existing code should be fixed in another commit, otherwise there will be too much noise in this patch.

78–79

Same here, please port the existing connections in another commit (which can be done later without rush for the 20.04 feature freeze).

121

Please use xi18nc instead.

423–426

The QObject:: prefix is not necessary.

svn/fileviewsvnplugin.h
73–74

Please use descriptive names for variables.

74

We should avoid adding overloaded slots without an actual reason. Let's come up with different names instead.

svn/svncommands.cpp
323

Did you mean "we should do a while here"?

svn/svncommands.h
61

Unrelated naming change, please do it in another commit.

svn/svnlogdialog.cpp
106–122

Please move this logic to a proper slot, not a lambda.

124–141

Same

145

Missing this as receiver.

145–155

Same

159

Missing this as receiver.

171

Missing this as receiver.

178

Missing this as receiver.

185

Missing this as receiver.

211

Please use i, it is usually the name of iterator variables.

234

Same here

This revision now requires changes to proceed.Mar 18 2020, 10:08 PM
nikolaik updated this revision to Diff 77978.Mar 19 2020, 7:28 AM

Update in response to comments.

nikolaik marked 16 inline comments as done.Mar 19 2020, 7:31 AM
nikolaik marked 2 inline comments as done.
elvisangelaccio accepted this revision.Mar 19 2020, 10:02 PM

Do you have commit access?

This revision is now accepted and ready to land.Mar 19 2020, 10:02 PM

Ah right, you probably don't (time to fix that!).

I'll push it for you since the freeze is very close.

This revision was automatically updated to reflect the committed changes.