Bazaar VCS integration ideas

Evgeniy Ivanov powerfox at kde.ru
Sat Jan 3 10:34:17 UTC 2009


Andreas Pakulat wrote:
> On 02.01.09 22:47:02, Evgeniy Ivanov wrote:
>> Happy New Year folks :)
>>
>> Some time ago I have found nice thing called QBzr:
>> http://bazaar-vcs.org/QBzr
>> AFAIK it's developed by one of K developers.
>> But it's a plugin and not a separate application like QGit.
>>
>> It has nice UI and functionality, which is in todo for our bzr plugin.
>> And many things could be reused since it's a kind of a library and it's
>> in python.
>>
>> It works in such way: bzr qCOMMAND (like commit, log, etc).
>>
>> I did some small experiments:
>>
>> #It will open a window as a Qt application, but AFAIK we can embed it,
>> but not sure
>> #I didn't set current dir (dir with repo), it's set by application's
>> active dir.
>>>>> from bzrlib.plugins.qbzr import cmd_qlog
>>>>> cmd_obj = cmd_qlog()
>>>>> run = cmd_obj.run_argv_aliases
>>>>> run([])
>> #It's better, since we control tree object (repo dir) and some other
>> things (we will not create application in KD)
>>>>> import sys
>>>>> from PyQt4 import QtGui, QtCore
>>>>> from bzrlib import workingtree
>>>>> from bzrlib.plugins.qbzr import CommitWindow
>>>>> tree =
>> workingtree.WorkingTree.open('/home/kde-devel/kdevelop-projects/bazaar')
>>>>> app = QtGui.QApplication(sys.argv)
>>>>> cm_window = CommitWindow(tree, [])
>>>>> cm_window.show()
> 
> Can we embed these widgets into our mainwindow? For example the log window
> would need to be inside a toolview, not a standalone window.

I guess we can. All items are public in python, so we have full access.
Maybe some tricks required, but should be easy.

> Quite frankly, I have no idea wether this will work out or not. It
> basically boils down to: How much control do we have over those
> windows/wigets? Can we for example pre-select the file that should be
> committed in the commit-window?

Class constructor has list argument, so I guess we can (even in case of
using this plugin as library). If we fork it then we will have full
control over all things, but doubt it's required.

> Can we limit the revisions to be shown in
> a log window?

Not sure. But currently there is no such functionality in our git plugin
 (Git folks develop libgit2, so we will be able to switch to it later).

> Does this really work with Kross (I have no idea wether PyQt4
> code works with C++ code via kross...)? Last but not least: Is this
> available in distro's? How many dependencies do we get with this?

It's availble in OpenSuse, should be avaible in *ubuntu and other
distros. We just need bzr (which is required anywhere) and qbzr plugin
for bzr.

> If you can play around with the code and answer the above questions, then
> we can make a decision wether to go down that road completely or not :)  
> 

I/we will :)


-- 
Cheers, Evgeniy.
Key fingerprint: F316 B5A1 F6D2 054F CD18 B74A 9540 0ABB 1FE5 67A3





More information about the KDevelop-devel mailing list