Thursday, April 25, 2024
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 11719  / 2 Years ago, fri, december 3, 2021, 7:55:55

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


More From » configuration

 Answers
5

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


[#24575] Saturday, December 4, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
panshow

Total Points: 454
Total Questions: 98
Total Answers: 122

Location: Philippines
Member since Sat, Jul 11, 2020
4 Years ago
;