comparison hgext/convert/hg.py @ 16689:f366d4c2ff34

cleanup: replace naked excepts with except Exception: ...
author Brodie Rao <brodie@sf.io>
date Sat, 12 May 2012 16:02:46 +0200
parents e34106fa0dc3
children 1093ad1e8903
comparison
equal deleted inserted replaced
16688:cfb6682961b8 16689:f366d4c2ff34
93 branchpath = os.path.join(self.path, branch) 93 branchpath = os.path.join(self.path, branch)
94 if setbranch: 94 if setbranch:
95 self.after() 95 self.after()
96 try: 96 try:
97 self.repo = hg.repository(self.ui, branchpath) 97 self.repo = hg.repository(self.ui, branchpath)
98 except: 98 except Exception:
99 self.repo = hg.repository(self.ui, branchpath, create=True) 99 self.repo = hg.repository(self.ui, branchpath, create=True)
100 self.before() 100 self.before()
101 101
102 # pbranches may bring revisions from other branches (merge parents) 102 # pbranches may bring revisions from other branches (merge parents)
103 # Make sure we have them, or pull them. 103 # Make sure we have them, or pull them.
104 missings = {} 104 missings = {}
105 for b in pbranches: 105 for b in pbranches:
106 try: 106 try:
107 self.repo.lookup(b[0]) 107 self.repo.lookup(b[0])
108 except: 108 except Exception:
109 missings.setdefault(b[1], []).append(b[0]) 109 missings.setdefault(b[1], []).append(b[0])
110 110
111 if missings: 111 if missings:
112 self.after() 112 self.after()
113 for pbranch, heads in missings.iteritems(): 113 for pbranch, heads in missings.iteritems():
190 parentctx = None 190 parentctx = None
191 tagparent = nullid 191 tagparent = nullid
192 192
193 try: 193 try:
194 oldlines = sorted(parentctx['.hgtags'].data().splitlines(True)) 194 oldlines = sorted(parentctx['.hgtags'].data().splitlines(True))
195 except: 195 except Exception:
196 oldlines = [] 196 oldlines = []
197 197
198 newlines = sorted([("%s %s\n" % (tags[tag], tag)) for tag in tags]) 198 newlines = sorted([("%s %s\n" % (tags[tag], tag)) for tag in tags])
199 if newlines == oldlines: 199 if newlines == oldlines:
200 return None, None 200 return None, None