equal
deleted
inserted
replaced
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
7 |
7 |
8 from mercurial.i18n import _ |
8 from mercurial.i18n import _ |
9 from mercurial.node import hex |
9 from mercurial.node import hex |
10 from mercurial import encoding, error, util |
10 from mercurial import encoding, util |
11 import errno, os |
11 import errno, os |
12 |
12 |
13 def valid(mark): |
13 def valid(mark): |
14 for c in (':', '\0', '\n', '\r'): |
14 for c in (':', '\0', '\n', '\r'): |
15 if c in mark: |
15 if c in mark: |
34 continue |
34 continue |
35 sha, refspec = line.split(' ', 1) |
35 sha, refspec = line.split(' ', 1) |
36 refspec = encoding.tolocal(refspec) |
36 refspec = encoding.tolocal(refspec) |
37 try: |
37 try: |
38 bookmarks[refspec] = repo.changelog.lookup(sha) |
38 bookmarks[refspec] = repo.changelog.lookup(sha) |
39 except error.RepoLookupError: |
39 except LookupError: |
40 pass |
40 pass |
41 except IOError, inst: |
41 except IOError, inst: |
42 if inst.errno != errno.ENOENT: |
42 if inst.errno != errno.ENOENT: |
43 raise |
43 raise |
44 return bookmarks |
44 return bookmarks |