comparison mercurial/pathutil.py @ 27235:054cd38a2f19

pathutil: use temporary variables instead of complicated wrapping The one-lining did not help readability, we get rid of it.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 03 Dec 2015 13:14:20 -0800
parents 79a86a95f325
children 0b7ce0b16d8a
comparison
equal deleted inserted replaced
27234:15c6eb0a51bd 27235:054cd38a2f19
109 # They must be ignored for patterns can be checked too. 109 # They must be ignored for patterns can be checked too.
110 if err.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL): 110 if err.errno not in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL):
111 raise 111 raise
112 else: 112 else:
113 if stat.S_ISLNK(st.st_mode): 113 if stat.S_ISLNK(st.st_mode):
114 raise error.Abort( 114 msg = _('path %r traverses symbolic link %r') % (path, prefix)
115 _('path %r traverses symbolic link %r') 115 raise error.Abort(msg)
116 % (path, prefix))
117 elif (stat.S_ISDIR(st.st_mode) and 116 elif (stat.S_ISDIR(st.st_mode) and
118 os.path.isdir(os.path.join(curpath, '.hg'))): 117 os.path.isdir(os.path.join(curpath, '.hg'))):
119 if not self.callback or not self.callback(curpath): 118 if not self.callback or not self.callback(curpath):
120 raise error.Abort(_("path '%s' is inside nested " 119 msg = _("path '%s' is inside nested repo %r")
121 "repo %r") % (path, prefix)) 120 raise error.Abort(msg % (path, prefix))
122 121
123 def check(self, path): 122 def check(self, path):
124 try: 123 try:
125 self(path) 124 self(path)
126 return True 125 return True