Multiple VCS roots within one project are not handled properly

Issue #1 resolved
Former user created an issue
2015-12-31 14:28:12,412 [2983357]   INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: [BitbucketReferences] 
2015-12-31 14:28:29,902 [3000847]  DEBUG -            BitbucketReferences - Disabled CopyFileUrlInBitbucketAction action for file 'myfile.py' 
2015-12-31 14:28:42,672 [3013617]  DEBUG -            BitbucketReferences - Disabled OpenFileInBitbucketAction action for file 'myfile.py' 
2015-12-31 14:29:06,631 [3037576]   INFO - packaging.PyPackageManagerImpl - Running packaging tool: /home/bartek/.pyenv/versions/sprint-59/bin/python /opt/pycharm-5.0.2/helpers/packaging_tool.py list 
2015-12-31 14:29:09,111 [3040056]  DEBUG -            BitbucketReferences - Disabled CopyFileUrlInBitbucketAction action for file 'myfile.py' 
2015-12-31 14:29:11,440 [3042385]  DEBUG -            BitbucketReferences - Disabled CopyFileUrlInBitbucketAction action for file 'myfile.py' 
2015-12-31 14:29:14,616 [3045561]  DEBUG -            BitbucketReferences - Disabled CopyFileUrlInBitbucketAction action for file 'myfile.py' 

You don't seem to mention Linux in description. I can't see any new context menus items. Pressing keys sends the above

Comments (18)

  1. Daniil Penkin staff

    Hello Bartek,

    Happy New Year! 🎄

    There's no restriction on OS, so the problem is likely related to something else. Could you please now reopen the affected project in your IDE so that we could see what happens right after project initialisation (Bitbucket discovery happens during that time)? Please attach fresh idea.log after that (or grep BitbucketReferences records).

    One possible reason is that you might use ssh aliases in your git / hg remote URL — aliases are not supported at the moment.

    Looking forward to hearing from you soon.

  2. Former user Account Deleted reporter

    Hi Daniil, Happy New Year to you too! :)

    No, I don't use aliases. I wonder whether this might to do with the fact that I have 4 projects open in the same window. Although the discovery looks successful to me. I remove some sensitive info, basically everything in CAPS is anonmyzed info:

    2015-12-31 15:07:28,430 [   3400]   INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: [BitbucketReferences] 
    2015-12-31 15:07:41,047 [  16017]  DEBUG -            BitbucketReferences - Scheduling discovery of Bitbucket remotes 
    2015-12-31 15:07:41,058 [  16028]  DEBUG -            BitbucketReferences - Started discovery of Bitbucket remotes for project 'ls' 
    2015-12-31 15:07:41,091 [  16061]  DEBUG -            BitbucketReferences - Analyzing hg remote url 'ssh://hg@bitbucket.org/MY_USER/MY_PROJECT' 
    2015-12-31 15:07:41,091 [  16061]  DEBUG -            BitbucketReferences - Found parameters: host 'bitbucket.org', path '/MY_USER/MY_PROJECT' 
    2015-12-31 15:07:41,092 [  16062]  DEBUG -            BitbucketReferences - Preparing Bitbucket Cloud URI Builder with base URI 'https://bitbucket.org/MY_USER/MY_PROJECT/' 
    2015-12-31 15:07:41,122 [  16092]  DEBUG -            BitbucketReferences - Analyzing git remote url 'git@bitbucket.org:MY_EMPLOYER/MY_PROJECT2.git' 
    2015-12-31 15:07:41,123 [  16093]  DEBUG -            BitbucketReferences - Prepending remote url 'git@bitbucket.org:MY_EMPLOYER/MY_PROJECT2.git' with ssh scheme for further analysis 
    2015-12-31 15:07:41,123 [  16093]  DEBUG -            BitbucketReferences - Found parameters: scheme 'ssh', host 'null', port '-1', authority 'git@bitbucket.org:MY_EMPLOYER', path '/MY_PROJECT2.git' 
    2015-12-31 15:07:41,124 [  16094]  DEBUG -            BitbucketReferences - Preparing Bitbucket Cloud URI Builder with base URI 'https://bitbucket.org/MY_EMPLOYER/MY_PROJECT2/' 
    2015-12-31 15:07:41,124 [  16094]  DEBUG -            BitbucketReferences - Analyzing git remote url 'git@bitbucket.org:MY_USER/ls-loggers.git' 
    2015-12-31 15:07:41,124 [  16094]  DEBUG -            BitbucketReferences - Prepending remote url 'git@bitbucket.org:MY_USER/ls-loggers.git' with ssh scheme for further analysis 
    2015-12-31 15:07:41,124 [  16094]  DEBUG -            BitbucketReferences - Found parameters: scheme 'ssh', host 'null', port '-1', authority 'git@bitbucket.org:MY_USER', path '/ls-loggers.git' 
    2015-12-31 15:07:41,124 [  16094]  DEBUG -            BitbucketReferences - Preparing Bitbucket Cloud URI Builder with base URI 'https://bitbucket.org/MY_USER/ls-loggers/' 
    2015-12-31 15:07:41,125 [  16095]  DEBUG -            BitbucketReferences - Found following remote Bitbucket git repositories for the project: {file:///home/bartek/workspace/ls=BitbucketCloudRemoteInfo{baseUri=https://bitbucket.org/MY_EMPLOYER/MY_PROJECT2/}, file:///home/bartek/workspace/ls/lsl=BitbucketCloudRemoteInfo{baseUri=https://bitbucket.org/MY_USER/ls-loggers/}} 
    2015-12-31 15:07:41,125 [  16095]   INFO -            BitbucketReferences - Discovered Bitbucket remote repositories for project 'ls': [BitbucketCloudUriBuilder{baseRepositoryUri=https://bitbucket.org/MY_USER/MY_PROJECT/, rootDirectory=file:///home/bartek/workspace/ls/default}, BitbucketCloudUriBuilder{baseRepositoryUri=https://bitbucket.org/MY_EMPLOYER/MY_PROJECT2/, rootDirectory=file:///home/bartek/workspace/ls}, BitbucketCloudUriBuilder{baseRepositoryUri=https://bitbucket.org/MY_USER/ls-loggers/, rootDirectory=file:///home/bartek/workspace/ls/lsl}] 
    2015-12-31 15:07:41,125 [  16095]  DEBUG -            BitbucketReferences - Finished discovery of Bitbucket remotes for project 'ls' 
    2015-12-31 15:08:43,410 [  78380]  DEBUG -            BitbucketReferences - Disabled CopyFileUrlInBitbucketAction action for file 'file:///home/bartek/workspace/ls/sprint-59/imports/management/commands/import_command.py' 
    2015-12-31 15:08:46,784 [  81754]  DEBUG -            BitbucketReferences - Disabled CopyFileUrlInBitbucketAction action for file 'file:///home/bartek/workspace/ls/sprint-59/imports/management/commands/import_command.py' 
    
  3. Former user Account Deleted reporter

    I have one repository cloned 3 times in the same folder, the plugin works on first one, not on the second two. This seems to be the problem.

    And let me just say this: your plugin is still awesome, I have written bad ugly bash aliases/function/scripts to automatize this

  4. Daniil Penkin staff

    In fact, I haven't tested such layout, so multi-repo support might be broken. I will try to reproduce the issue and fix it.

    Just to be sure that we have same picture of what's happening: what I see is that you have following directory/remote repo structure:

    ls                                       -- git repository (MY_EMPLOYER/MY_PROJECT2)
    |___default                              -- hg repository (MY_USER/MY_PROJECT)
    |___lsl                                  -- git repository (MY_USER/ls-loggers)
    |___sprint-59
        |___...
            |___commands
                |___import_commands.py       -- affected file
    

    So, import_commands.py is in the topmost git repo (MY_EMPLOYER/MY_PROJECT2), right?

  5. Daniil Penkin staff

    And let me just say this: your plugin is still awesome, I have written bad ugly bash aliases/function/scripts to automatize this

    Thank you, Bartek! I'm happy that the plugin is useful :) There're still a lot of improvements to be done there though...

  6. Former user Account Deleted reporter

    Your tree is mostly correct, with sprint-59 being another hg repository. Good discovery skills :). To complicate further, my ~ is another git repo. But this is not the issue, I have the answer.

    • I created special test repository with two branches (https://bitbucket.org/bartekz/budda/commits/all).
    • Cloned them both inside a folder and set each to a different branch
    • Opened that super-folder in PyCharm, so both repos are in same window
    • First works, second doesn't

    Further checks:

    • branches don't matter, it's the fact that two same urls are open in one PyCharm project, opening repos separately solves the issue (but I can't work this way)

    Anyway, hope this helps. Feel free to ask for further debug. Do you have plugin code opensourced somewhere? I'd love to read it to learn how plugins work. Of course, I understand if you chose not to publish it for some reason.

  7. Former user Account Deleted reporter

    Just realized you work at Atlassian! :) Ok, there might be good reasons it's closed-source. Or.. are there?

  8. Daniil Penkin staff

    Ok, I see. For some reason the plugin didn't recognise that sprint-59 being a hg repo root.

    Thank you for detailed steps to reproduce and your readiness to help!

    As for the home directory, it doesn't really matter as the plugin relies on what IDEA knows about repositories in your project, that said only directories under the project root do matter (so, in IDEA's terms, you have a project with several VCS roots).

    The reason behind the problem might be in the setup (maybe that hg root is not registered in IDEA?) or in a bug of the plugin (much more likely). I'll try to reproduce an reveal the truth :)

    As regards the source code, it was in fact publicly available until recently when I had to hide it cause we did some scary things against this repo during our last hackathon. I have to clean up the repo a bit and to re-open it again. Sorry for the inconvenience.

    Just realized you work at Atlassian! :) Ok, there might be good reasons it's closed-source. Or.. are there?

    True, but this is what I do beside my usual work, so the plugin is not official nor anyhow supported by Atlassian. And no, there is no single reason for closing the source code except for the cleanup I mentioned earlier. So stay tuned, I'll bring it back to life soon :)

  9. Daniil Penkin staff

    That was a stupid bug :) Only mercurial repos were affected. Thanks again for sample repository — it helped!

    Please try the attached version (Preferences → Plugins → Install plugin from disk...).

    If it works fine, I'll release and publish a plugin with that fix. There's no need to uninstall manually added plugin version as PyCharm will prompt you about upgrade as soon as 1.5 will be available.

  10. Former user Account Deleted reporter

    Works correctly. Thank you! Now, I'll go and promote this plugin among the colleagues. It is a time saver, especially in our complex setup. And looking forward to see the code!

  11. Daniil Penkin staff

    Nice, happy to hear that. Thank you for trying it out!

    I will publish official version soon. And yes, the code too (a bit later though).

  12. Log in to comment