##// END OF EJS Templates
bookmarks: factor out bookmark file opening for easier extensibility
Ryan McElroy -
r23458:756376ec default
parent child Browse files
Show More
@@ -30,15 +30,7 b' class bmstore(dict):'
30 dict.__init__(self)
30 dict.__init__(self)
31 self._repo = repo
31 self._repo = repo
32 try:
32 try:
33 bkfile = None
33 bkfile = self.getbkfile(repo)
34 if 'HG_PENDING' in os.environ:
35 try:
36 bkfile = repo.vfs('bookmarks.pending')
37 except IOError, inst:
38 if inst.errno != errno.ENOENT:
39 raise
40 if bkfile is None:
41 bkfile = repo.vfs('bookmarks')
42 for line in bkfile:
34 for line in bkfile:
43 line = line.strip()
35 line = line.strip()
44 if not line:
36 if not line:
@@ -57,6 +49,18 b' class bmstore(dict):'
57 if inst.errno != errno.ENOENT:
49 if inst.errno != errno.ENOENT:
58 raise
50 raise
59
51
52 def getbkfile(self, repo):
53 bkfile = None
54 if 'HG_PENDING' in os.environ:
55 try:
56 bkfile = repo.vfs('bookmarks.pending')
57 except IOError, inst:
58 if inst.errno != errno.ENOENT:
59 raise
60 if bkfile is None:
61 bkfile = repo.vfs('bookmarks')
62 return bkfile
63
60 def recordchange(self, tr):
64 def recordchange(self, tr):
61 """record that bookmarks have been changed in a transaction
65 """record that bookmarks have been changed in a transaction
62
66
General Comments 0
You need to be logged in to leave comments. Login now