[PATCH 1 of 2] manifest: rename ambiguously-named set to setflag

Augie Fackler raf at durin42.com
Tue Oct 14 13:43:24 CDT 2014


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1412964577 14400
#      Fri Oct 10 14:09:37 2014 -0400
# Node ID 1df92f6c6eb1731fd5b3fceac54be06524c68fe8
# Parent  4a1d0e9d24488ea3b3ac57a8bd5ad2353e8c2801
manifest: rename ambiguously-named set to setflag

Just makes it a little clearer what this method does.

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,7 @@
         return self._flags.get(f, "")
     def withflags(self):
         return set(self._flags.keys())
-    def set(self, f, flags):
+    def setflag(self, f, flags):
         self._flags[f] = flags
     def copy(self):
         return manifestdict(self, dict.copy(self._flags))


More information about the Mercurial-devel mailing list