Issue #30 open

(with patch) checkout with dirty working directory causes crash

bobpaul
created an issue

I assume this is another api change, but I haven't had time to really look. Here's the error text:

{{{

!bug

unknown exception encountered, details follow report bug details to http://mercurial.selenic.com/bts/ or mercurial@selenic.com Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] Mercurial Distributed SCM (version 1.6.4) Extensions loaded: task Traceback (most recent call last): File "/usr/bin/hg", line 27, in <module> mercurial.dispatch.run() File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 16, in run sys.exit(dispatch(sys.argv[1:])) File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 34, in dispatch return _runcatch(u, args) File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 54, in _runcatch return _dispatch(ui, args) File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 494, in _dispatch cmdpats, cmdoptions) File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 355, in runcommand ret = _runcommand(ui, options, cmd, d) File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 545, in _runcommand return checkargs() File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 499, in checkargs return cmdfunc() File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 492, in <lambda> d = lambda: util.checksignature(func)(ui, args, cmdoptions) File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 420, in check return func(*args, kwargs) File "/usr/lib/pymodules/python2.6/mercurial/extensions.py", line 129, in wrap util.checksignature(origfn), args, kwargs) File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 420, in check return func(*args, kwargs) File "/home/paulk/.hgext/hgtask.py", line 897, in tasksupdate if stash(ui, repo, currenttask): File "/home/paulk/.hgext/hgtask.py", line 606, in stash repo.remove(st[3]) AttributeError: 'task_repo' object has no attribute 'remove'

}}}

Attached you'll find the steps to reproduce.

Comments (6)

  1. bobpaul reporter

    Checking out the mercurial 1.5.4 release, I see patch.py, cmdutil.py, and commands.py all use repo.remove(), but this syntax is missing in 1.6.x. I'm only now investigating what needs to be changed on our end.

  2. bobpaul reporter

    Ok, fixed. Attached is a patch that fixes the issue. I just copied the procedure done in mercurial's commands.py

    This might not work on 1.4.x or 1.5.x

  3. alu repo owner
    • changed status to open

    I have some thoughts about how stash works/doesn't work. I have some tests that make it not behave the way I would hope.

    This crash should be fixed by killermonk's fork, but I am wondering if your lock is required.

  4. bobpaul reporter

    I actually have no idea whether the lock is required or not. Like I said, I just copied the procedure from used in commands.py for similar behavior. I can confirm killermonk's procedure seems to work equally well for at least the stash-but.sh test case. I hadn't seen his repo until I'd done most of my work. :(

  5. Log in to comment