show only svn in RabbitVCS context menu

After install of RabbitVCS I get git, svn and Hg integration in Nautilus. How to remove Hg and Git from context menu?


I've found a hackingish way of doing that. I'm assuming you've installed rabbitvcs-nautilus. I've tested it in Ubuntu 16.04.

After installing it, if you restart nautilus, you'll find entry for three types of VCS, namely git, mercurial (hg) and SVN. Here is a screenshot of context menu after default installation.

Default menu items with git, hg and svn

Now, to remove git and mercurial menus, Open /usr/lib/python2.7/dist-packages/rabbitvcs/util/contextmenu.py with your favorite text editor. I'm using sublime text in the example

subl /usr/lib/python2.7/dist-packages/rabbitvcs/util/contextmenu.py

Now, go to line 1329. Comment-out lines from 1329 to 1372. Which are basically menu item entries for git and mercurial. After commenting out, the lines become

File: /usr/lib/python2.7/dist-packages/rabbitvcs/util/contextmenu.py
1329:             # (MenuRabbitVCSGit, [
1330:             #     (MenuClone, None),
1331:             #     (MenuInitializeRepository, None),
1332:             #     (MenuSeparator, None),
1333:             #     (MenuDiffMenu, [
1334:             #         (MenuDiff, None),
1335:             #         (MenuDiffPrevRev, None),
1336:             #         (MenuDiffMultiple, None),
1337:             #         (MenuCompareTool, None),
1338:             #         (MenuCompareToolPrevRev, None),
1339:             #         (MenuCompareToolMultiple, None),
1340:             #         (MenuShowChanges, None),
1341:             #     ]),
1342:             #     (MenuShowLog, None),
1343:             #     (MenuStage, None),
1344:             #     (MenuUnstage, None),
1345:             #     (MenuAddToIgnoreList, ignore_items),
1346:             #     (MenuSeparator, None),
1347:             #     (MenuRename, None),
1348:             #     (MenuDelete, None),
1349:             #     (MenuRevert, None),
1350:             #     (MenuClean, None),
1351:             #     (MenuReset, None),
1352:             #     (MenuCheckout, None),
1353:             #     (MenuSeparator, None),
1354:             #     (MenuBranches, None),
1355:             #     (MenuTags, None),
1356:             #     (MenuRemotes, None),
1357:             #     (MenuSeparator, None),
1358:             #     (MenuGitExport, None),
1359:             #     (MenuMerge, None),
1360:             #     (MenuSeparator, None),
1361:             #     (MenuAnnotate, None),
1362:             #     (MenuSeparator, None),
1363:             #     (MenuCreatePatch, None),
1364:             #     (MenuApplyPatch, None),
1365:             #     (MenuSeparator, None),
1366:             #     (MenuSettings, None),
1367:             #     (MenuAbout, None)
1368:             # ]),
1369:             # (MenuRabbitVCSMercurial, [
1370:             #     (MenuSettings, None),
1371:             #     (MenuAbout, None)
1372:             # ])
1373:         ]
1374: 

I've printed line numbers here.

Here is two screenshot which shows the context menu before and after of disabling this.

Screenshot: After disabling

After disabling Git and HG


In the folder ~/.config/rabbitvcs, edit settings.conf.

In the section [HideItem], add the line hg = True.