Issue2016

Title broken bookmarks
Priority bug Status chatting
Superseder Nosy List abuehl, axl, dsp
Assigned To dsp Topics

Created on 2010-02-02.19:56:36 by axl, last changed 2010-02-03.15:26:36 by axl.

Files
File name Uploaded Type Edit Remove
branches.zip axl, 2010-02-02.19:56:35 application/x-zip-compressed
Messages
msg11579 (view) Author: axl Date: 2010-02-03.15:26:35
Hmm, there's no such change?

I think I figured out a repro case anyway, this one on a mac, latest version 
osx and hg. The key is to set a bookmark to a change and then rollback that 
change. The bookmark now points to a non-existing change.

Dumbledore:htest axl$ hg init a
Dumbledore:htest axl$ cd a
Dumbledore:a axl$ echo foo>foo
Dumbledore:a axl$ hg add
adding foo
Dumbledore:a axl$ hg ci -m "foo"
Dumbledore:a axl$ echo bar>>foo
Dumbledore:a axl$ hg ci -m "foo2"
Dumbledore:a axl$ hg up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Dumbledore:a axl$ hg tag 1.0
Dumbledore:a axl$ hg bookmark 1.0
Dumbledore:a axl$ hg rollback
rolling back last transaction
Dumbledore:a axl$ hg forget .hgtags 
Dumbledore:a axl$ rm .hgtags 
Dumbledore:a axl$ hg bookmarks
no bookmarks set
Dumbledore:a axl$ hg bookmark master
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.4.2+20100104)
** Extensions loaded: bookmarks, graphlog
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 27, in <module>
    mercurial.dispatch.run()
  File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 16, 
in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 30, 
in dispatch
    return _runcatch(u, args)
  File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 46, 
in _runcatch
    return _dispatch(ui, args)
  File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 454, 
in _dispatch
    return runcommand(lui, repo, cmd, fullargs, ui, options, d)
  File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 324, 
in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 505, 
in _runcommand
    return checkargs()
  File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 459, 
in checkargs
    return cmdfunc()
  File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 453, 
in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/Library/Python/2.6/site-packages/mercurial/util.py", line 386, in 
check
    return func(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/hgext/bookmarks.py", line 172, in 
bookmark
    if ((mark in repo.branchtags() or mark == repo.dirstate.branch())
  File "/Library/Python/2.6/site-packages/mercurial/localrepo.py", line 344, 
in branchtags
    for bn, heads in self.branchmap().iteritems():
AttributeError: 'NoneType' object has no attribute 'iteritems'
Dumbledore:a axl$
msg11576 (view) Author: dsp Date: 2010-02-03.11:04:47
Seems like this is broken since c03f467423f3.

can you provide a reproduce script?
msg11568 (view) Author: axl Date: 2010-02-02.19:56:35
I was messing around with bookmarks, just to figure out the best way to work 
with a possible branching setup I had in mind. However, it didn't take long 
before the bookmarks extension started failing. And since I had just been at 
it for a few minutes I thought I'd attach the entire repo and details on 
what I'd been doing.

In the attached repo:
* Adding new bookmarks crashes hg.
* Listing bookmarks says there are none.
* The .hg\bookmarks file lists the two bookmarks I had setup

I ran this on a non-standard setup so the log of what I was doing is 
incomplete, forgot to change the default buffer size. But at least I caught 
one operation that could be the culprit, I added a tag instead of a bookmark 
and did a rollback on that change, just before the buffer wrapped.

C:\Data\code\axl\hgtest\branches>del .hgtags
C:\Data\code\axl\hgtest\branches>hg st
! .hgtags
C:\Data\code\axl\hgtest\branches>hg forget .hg
abort: path contains illegal component: .hg
C:\Data\code\axl\hgtest\branches>hg forget .hgtags
C:\Data\code\axl\hgtest\branches>hg st
C:\Data\code\axl\hgtest\branches>hg glog
@  changeset:   6:f1192a0daae4
|  tag:         tip
|  parent:      4:37771107bb05
|  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
|  date:        Tue Feb 02 20:32:19 2010 +0100
|  summary:     more stuff
|
| o  changeset:   5:c5bfdac18b46
| |  parent:      1:cb96ae0c9652
| |  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
| |  date:        Tue Feb 02 20:31:47 2010 +0100
| |  summary:     added shebang
| |
o |  changeset:   4:37771107bb05
| |  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
| |  date:        Tue Feb 02 20:23:08 2010 +0100
| |  summary:     foo 3
| |
o |  changeset:   3:e2d33fb2dc42
| |  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
| |  date:        Tue Feb 02 20:21:34 2010 +0100
| |  summary:     bar2
| |
o |  changeset:   2:3e625e10b57a
| |  parent:      0:f730321deaf7
| |  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
| |  date:        Tue Feb 02 20:21:16 2010 +0100
| |  summary:     bar
| |
| o  changeset:   1:cb96ae0c9652
|/   user:        Andreas Axelsson <andreas.axelsson@gmail.com>
|    date:        Tue Feb 02 20:20:56 2010 +0100
|    summary:     foo2
|
o  changeset:   0:f730321deaf7
   user:        Andreas Axelsson <andreas.axelsson@gmail.com>
   date:        Tue Feb 02 20:20:46 2010 +0100
   summary:     foo


C:\Data\code\axl\hgtest\branches>hg bookmark -r 2 dev
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.4.1)
** Extensions loaded: extdiff, hgk, graphlog, rebase, bookmarks
Traceback (most recent call last):
  File "hg", line 36, in <module>
  File "mercurial\dispatch.pyo", line 16, in run
  File "mercurial\dispatch.pyo", line 30, in dispatch
  File "mercurial\dispatch.pyo", line 46, in _runcatch
  File "mercurial\dispatch.pyo", line 449, in _dispatch
  File "mercurial\dispatch.pyo", line 319, in runcommand
  File "mercurial\dispatch.pyo", line 500, in _runcommand
  File "mercurial\dispatch.pyo", line 454, in checkargs
  File "mercurial\dispatch.pyo", line 448, in <lambda>
  File "mercurial\util.pyo", line 386, in check
  File "hgext\bookmarks.pyo", line 172, in bookmark
  File "mercurial\localrepo.pyo", line 344, in branchtags
AttributeError: 'NoneType' object has no attribute 'iteritems'

C:\Data\code\axl\hgtest\branches>hg up 2
2 files updated, 0 files merged, 1 files removed, 0 files unresolved

C:\Data\code\axl\hgtest\branches>hg bookmark dev
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.4.1)
** Extensions loaded: extdiff, hgk, graphlog, rebase, bookmarks
Traceback (most recent call last):
  File "hg", line 36, in <module>
  File "mercurial\dispatch.pyo", line 16, in run
  File "mercurial\dispatch.pyo", line 30, in dispatch
  File "mercurial\dispatch.pyo", line 46, in _runcatch
  File "mercurial\dispatch.pyo", line 449, in _dispatch
  File "mercurial\dispatch.pyo", line 319, in runcommand
  File "mercurial\dispatch.pyo", line 500, in _runcommand
  File "mercurial\dispatch.pyo", line 454, in checkargs
  File "mercurial\dispatch.pyo", line 448, in <lambda>
  File "mercurial\util.pyo", line 386, in check
  File "hgext\bookmarks.pyo", line 172, in bookmark
  File "mercurial\localrepo.pyo", line 344, in branchtags
AttributeError: 'NoneType' object has no attribute 'iteritems'

C:\Data\code\axl\hgtest\branches>echo newfeature>newfeature

C:\Data\code\axl\hgtest\branches>hg add
adding newfeature

C:\Data\code\axl\hgtest\branches>hg ci -m "new shit"
created new head

C:\Data\code\axl\hgtest\branches>hg bookmark dev
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.4.1)
** Extensions loaded: extdiff, hgk, graphlog, rebase, bookmarks
Traceback (most recent call last):
  File "hg", line 36, in <module>
  File "mercurial\dispatch.pyo", line 16, in run
  File "mercurial\dispatch.pyo", line 30, in dispatch
  File "mercurial\dispatch.pyo", line 46, in _runcatch
  File "mercurial\dispatch.pyo", line 449, in _dispatch
  File "mercurial\dispatch.pyo", line 319, in runcommand
  File "mercurial\dispatch.pyo", line 500, in _runcommand
  File "mercurial\dispatch.pyo", line 454, in checkargs
  File "mercurial\dispatch.pyo", line 448, in <lambda>
  File "mercurial\util.pyo", line 386, in check
  File "hgext\bookmarks.pyo", line 172, in bookmark
  File "mercurial\localrepo.pyo", line 344, in branchtags
AttributeError: 'NoneType' object has no attribute 'iteritems'

C:\Data\code\axl\hgtest\branches>hg glog
@  changeset:   7:f568c0d59874
|  tag:         tip
|  parent:      2:3e625e10b57a
|  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
|  date:        Tue Feb 02 20:36:41 2010 +0100
|  summary:     new shit
|
| o  changeset:   6:f1192a0daae4
| |  parent:      4:37771107bb05
| |  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
| |  date:        Tue Feb 02 20:32:19 2010 +0100
| |  summary:     more stuff
| |
| | o  changeset:   5:c5bfdac18b46
| | |  parent:      1:cb96ae0c9652
| | |  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
| | |  date:        Tue Feb 02 20:31:47 2010 +0100
| | |  summary:     added shebang
| | |
| o |  changeset:   4:37771107bb05
| | |  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
| | |  date:        Tue Feb 02 20:23:08 2010 +0100
| | |  summary:     foo 3
| | |
| o |  changeset:   3:e2d33fb2dc42
|/ /   user:        Andreas Axelsson <andreas.axelsson@gmail.com>
| |    date:        Tue Feb 02 20:21:34 2010 +0100
| |    summary:     bar2
| |
o |  changeset:   2:3e625e10b57a
| |  parent:      0:f730321deaf7
| |  user:        Andreas Axelsson <andreas.axelsson@gmail.com>
| |  date:        Tue Feb 02 20:21:16 2010 +0100
| |  summary:     bar
| |
| o  changeset:   1:cb96ae0c9652
|/   user:        Andreas Axelsson <andreas.axelsson@gmail.com>
|    date:        Tue Feb 02 20:20:56 2010 +0100
|    summary:     foo2
|
o  changeset:   0:f730321deaf7
   user:        Andreas Axelsson <andreas.axelsson@gmail.com>
   date:        Tue Feb 02 20:20:46 2010 +0100
   summary:     foo


C:\Data\code\axl\hgtest\branches>hg bookmarks
no bookmarks set

C:\Data\code\axl\hgtest\branches>more .hg\bookmarks
f5840ac2b91bf71a1037585a8a4f88754432f9c7 master
c5bfdac18b46d9a3c73a7443c19b656a31d48c3f bug-1234

C:\Data\code\axl\hgtest\branches>more .hg\bookmarks.current
master

C:\Data\code\axl\hgtest\branches>hg up master
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.4.1)
** Extensions loaded: extdiff, hgk, graphlog, rebase, bookmarks
Traceback (most recent call last):
  File "hg", line 36, in <module>
  File "mercurial\dispatch.pyo", line 16, in run
  File "mercurial\dispatch.pyo", line 30, in dispatch
  File "mercurial\dispatch.pyo", line 46, in _runcatch
  File "mercurial\dispatch.pyo", line 449, in _dispatch
  File "mercurial\dispatch.pyo", line 319, in runcommand
  File "mercurial\dispatch.pyo", line 500, in _runcommand
  File "mercurial\dispatch.pyo", line 454, in checkargs
  File "mercurial\dispatch.pyo", line 448, in <lambda>
  File "mercurial\util.pyo", line 386, in check
  File "mercurial\commands.pyo", line 3200, in update
  File "mercurial\hg.pyo", line 339, in update
  File "mercurial\merge.pyo", line 453, in update
  File "mercurial\localrepo.pyo", line 129, in __getitem__
  File "mercurial\context.pyo", line 27, in __init__
  File "hgext\bookmarks.pyo", line 253, in lookup
  File "mercurial\localrepo.pyo", line 437, in lookup
  File "mercurial\localrepo.pyo", line 344, in branchtags
AttributeError: 'NoneType' object has no attribute 'iteritems'

C:\Data\code\axl\hgtest\branches>
History
Date User Action Args
2010-02-03 15:26:36axlsetnosy: abuehl, dsp, axl
messages: + msg11579
2010-02-03 11:04:56dspsetassignedto: dsp
nosy: abuehl, dsp, axl
2010-02-03 11:04:47dspsetnosy: abuehl, dsp, axl
messages: + msg11576
2010-02-03 11:03:20dspsetstatus: unread -> chatting
nosy: + dsp
2010-02-02 22:01:26abuehlsetnosy: + abuehl
2010-02-02 19:56:36axlcreate