Patchwork [1,of,2,v2] manifest: rename ambiguously-named set to setflag

login
register
mail settings
Submitter Augie Fackler
Date Oct. 14, 2014, 7:36 p.m.
Message ID <8c327b7a79460857a4c8.1413315381@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/6252/
State Accepted
Headers show

Comments

Augie Fackler - Oct. 14, 2014, 7:36 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1412964577 14400
#      Fri Oct 10 14:09:37 2014 -0400
# Node ID 8c327b7a79460857a4c81ed0272bd543d88b7997
# Parent  4a1d0e9d24488ea3b3ac57a8bd5ad2353e8c2801
manifest: rename ambiguously-named set to setflag

Just makes it a little clearer what this method does.

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1057,7 +1057,7 @@ 
                 orig = copied.get(f, f)
                 man[f] = getman(orig).get(orig, nullid) + i
                 try:
-                    man.set(f, ff(f))
+                    man.setflag(f, ff(f))
                 except OSError:
                     pass
 
@@ -1382,7 +1382,7 @@ 
         modified, added, removed = s[0:3]
         for f in modified + added:
             mf[f] = None
-            mf.set(f, self.flags(f))
+            mf.setflag(f, self.flags(f))
         for f in removed:
             if f in mf:
                 del mf[f]
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1404,7 +1404,7 @@ 
                         else:
                             new[f] = self._filecommit(fctx, m1, m2, linkrev,
                                                       trp, changed)
-                            m1.set(f, fctx.flags())
+                            m1.setflag(f, fctx.flags())
                     except OSError, inst:
                         self.ui.warn(_("trouble committing %s!\n") % f)
                         raise
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -21,7 +21,8 @@ 
         return self._flags.get(f, "")
     def withflags(self):
         return set(self._flags.keys())
-    def set(self, f, flags):
+    def setflag(self, f, flags):
+        """Set the flags (symlink, executable) for path f."""
         self._flags[f] = flags
     def copy(self):
         return manifestdict(self, dict.copy(self._flags))