pathutil: use temporary variables instead of complicated wrapping
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 03 Dec 2015 13:14:20 -0800
changeset 27235 054cd38a2f19
parent 27234 15c6eb0a51bd
child 27236 b0d90fef16b6
pathutil: use temporary variables instead of complicated wrapping The one-lining did not help readability, we get rid of it.
mercurial/pathutil.py
--- a/mercurial/pathutil.py	Thu Dec 03 13:23:46 2015 -0800
+++ b/mercurial/pathutil.py	Thu Dec 03 13:14:20 2015 -0800
@@ -111,14 +111,13 @@
                 raise
         else:
             if stat.S_ISLNK(st.st_mode):
-                raise error.Abort(
-                    _('path %r traverses symbolic link %r')
-                    % (path, prefix))
+                msg = _('path %r traverses symbolic link %r') % (path, prefix)
+                raise error.Abort(msg)
             elif (stat.S_ISDIR(st.st_mode) and
                   os.path.isdir(os.path.join(curpath, '.hg'))):
                 if not self.callback or not self.callback(curpath):
-                    raise error.Abort(_("path '%s' is inside nested "
-                                        "repo %r") % (path, prefix))
+                    msg = _("path '%s' is inside nested repo %r")
+                    raise error.Abort(msg % (path, prefix))
 
     def check(self, path):
         try: