Issue #597 duplicate

Error on update after pull with git subrepos

Sean McGivern
created an issue

Attempted to update to tip from context menu after a straight pull (from toolbar). I have several git subrepos in my repository. Command line "hg update" worked without issue.

{{{

!python

Mercurial version (1.8.2). TortoiseHg version (2.0.3) Command: --nofork workbench CWD: C:\Users\Sean\vimfiles Extensions loaded: fixfrozenexts, convert Python version: 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)] Windows version: (6, 1, 7601, 2, 'Service Pack 1') Processor architecture: x64 Qt-4.7.1 PyQt-4.8.2 Traceback (most recent call last): File "tortoisehg\hgqt\update.pyo", line 251, in update File "tortoisehg\hgqt\update.pyo", line 203, in isclean File "mercurial\subrepo.pyo", line 784, in dirty File "mercurial\subrepo.pyo", line 709, in _gitstate File "mercurial\subrepo.pyo", line 666, in _gitcommand File "mercurial\subrepo.pyo", line 670, in _gitdir File "mercurial\subrepo.pyo", line 686, in _gitnodir File "subprocess.pyo", line 623, in init File "subprocess.pyo", line 833, in _execute_child WindowsError: [Error 2] The system cannot find the file specified

}}}

Comments (11)

  1. Steve Borho
    • changed status to open

    I suspect there is a bug in Mercurial's git subrepo code that prevents it from working correctly in some cases when the command is not run within the base repository's root; which is how the Workbench often operates.

    Is this error repeatable if you start the Workbench from the start menu?

  2. Sean McGivern reporter

    It appears that I can't even clone the repo with TortoiseHg.

    Just for info: the repository contains one Hg subrepo and 4 git subrepos. TagBar is a git subrepo, Gundo is an Hg subrepo.

    I have confirmed that command line clone works irrespective of whether I am in my home directory or in c:\windows\system32 (into %HOME%\asdf in both cases).

    In below outputs (from Details button in Clone dialog -- I don't get an error dialog), I have removed a bunch of messages for successfully transferred files and replaced them with [...] just to shorten the outputs. As you suspected, they have different error messages.

    When opening Workbench from Start Menu:

    % hg clone --verbose https://WSMcG@bitbucket.org/WSMcG/vimrc -- C:\Users\Sean\asdf
    http authorization required
    realm: Bitbucket.org HTTP
    user: WSMcG
    requesting all changes
    adding changesets
    adding manifests
    adding file changes
    added 4 changesets with 19 changes to 15 files
    updating to branch default
    resolving manifests
    getting .hgsub
    getting .hgsubstate
    pulling subrepo bundle\gundo from http://bitbucket.org/sjl/gundo.vim
    real URL is https://bitbucket.org/sjl/gundo.vim
    requesting all changes
    adding changesets
    adding manifests
    adding file changes
    added 120 changesets with 206 changes to 72 files
    resolving manifests
    getting .hgignore
    getting .hgtags
    getting README.markdown
    getting doc/gundo.txt
    getting plugin/gundo.vim
    getting site/Essays1743.ttf
    getting site/index.html
    getting site/less.js
    getting site/publish.sh
    getting site/style.less
    getting tests/README.markdown
    getting tests/bundled/lh-vim-lib/autoload/lh/UT.vim
    [...]
    getting tests/vimrc_test
    cloning subrepo bundle/tagbar
    abort: The handle is invalid
    [command returned code 255 Sat Apr 16 17:21:49 2011]
    

    When opening Workbench from context menu in home directory:

    % hg clone --verbose https://WSMcG@bitbucket.org/WSMcG/vimrc -- C:\Users\Sean\asdf
    http authorization required
    realm: Bitbucket.org HTTP
    user: WSMcG
    requesting all changes
    adding changesets
    adding manifests
    adding file changes
    added 4 changesets with 19 changes to 15 files
    updating to branch default
    resolving manifests
    getting .hgsub
    getting .hgsubstate
    pulling subrepo bundle\gundo from http://bitbucket.org/sjl/gundo.vim
    real URL is https://bitbucket.org/sjl/gundo.vim
    requesting all changes
    adding changesets
    adding manifests
    adding file changes
    added 120 changesets with 206 changes to 72 files
    resolving manifests
    getting .hgignore
    getting .hgtags
    getting README.markdown
    getting doc/gundo.txt
    getting plugin/gundo.vim
    getting site/Essays1743.ttf
    getting site/index.html
    getting site/less.js
    getting site/publish.sh
    getting site/style.less
    getting tests/README.markdown
    getting tests/bundled/lh-vim-lib/autoload/lh/UT.vim
    [...]
    getting tests/vimrc_test
    cloning subrepo bundle/tagbar
    abort: The system cannot find the file specified
    [command returned code 255 Sat Apr 16 17:27:27 2011]
    
  3. Sean McGivern reporter

    Be happy to, but I don't know how. Everything works fine from the command line hg. I tried running "thg --nofork log" (ie RTFM) from the command line and doing the clone, and it worked fine. However, the output from the git subrepo clones came up on the command line, but the hg repo (both main and subrepo) output did not. I assume they were captured in the GUI.

  4. Steve Borho

    Not necessarily; it depends on how the git output is handled by Mercurial itself. If it's being dumped to stdout or stderr, it won't make it to our dialog window.

    To get tracebacks from the GUI, set [ui] traceback=1 in your Mercurial.ini file before you start the command you would like to debug (then set it back to zero afterwards).

  5. Sean McGivern reporter

    Odd. I had already put traceback=true into my mercurial.ini file, and I get tracebacks if I just run hg from the command line. However, I do not see them in the Details dialog. Even if I try to run it directly in the "Output Log" pane with --traceback, I don't see them.

    I tried a couple of other things: "thg clone" from the command line brings up the dialog. It works correctly and gets all git subrepos. However, it goes immediately back to the command prompt (obviously open new process) and has no output.

    "thg --nofork clone" works right also but shows the git output on the command line. No difference in the --nofork output if we turn off capture of stderr in thg.

  6. Steve Borho

    Gah, traceback used to work. I have no idea why that quit working.

    Anyway, my new theory is that git.exe isn't in the %PATH% when you don't launch from the command line. Is there a way you can test that?

  7. Sean McGivern reporter

    I don't know of a way to check it for an individual executable. The git bin directory is in the system path (not added in the user variables).

    I can run git from the "Output Log" window inside the Workbench (opened from Start Menu). It will successfully clone a git repo, but it only shows a single line saying "Cloning <repository>" rather than showing the number of objects transferred, etc. Unfortunately, running "set" in the output window gives me a "failed to run command" error.

    The fact that I can run it without a path inside Workbench should show that it is in the path, I'd guess.

  8. Sean McGivern reporter

    Funny thing. I cloned https://WSMcG@bitbucket.org/tortoisehg/thg and ran "python thg" and it cloned fine. However, when I started it with "pythonw thg" it failed with the "The handle is invalid" error. I also got a bunch of certificate warnings from bitbucket with both of them that I don't get in Windows command line but I do see in an Ubuntu virtual machine I run.

  9. Steve Borho

    That is real curious. It's possible git is refusing to run without a terminal. I fixed a similar bug in Mercurial a couple months back with 2ef915184ff2.

    Arg, now it's doubly annoying that traceback is not working.

    The certificate warnings are caused by the lack of web.cacerts configuration when you're not using a binary installer.

  10. Log in to comment