Patchwork [1,of,6] verify: move verify logic into a class

login
register
mail settings
Submitter Durham Goode
Date Dec. 19, 2015, 6:58 p.m.
Message ID <3E40552C-08A3-4C39-8798-086F15AFE2EB@fb.com>
Download mbox | patch
Permalink /patch/12184/
State Accepted
Commit 937e73a6e4ffc15ce6c6e9ec635e64f93fa59931
Headers show

Comments

Durham Goode - Dec. 19, 2015, 6:58 p.m.
On 12/19/15, 10:50 AM, "Sean Farley" <sean@farley.io> wrote:

>

>Durham Goode <durham@fb.com> writes:

>

>> Look at it with diff -w.  It's only a few lines of change with that.

>

>Sure but then I have to review on the command line which makes it

>difficult to correlate to the diff in this patch. Anyway, if others feel

>differently then no big deal.


I'll try to follow that pattern in the future.  Unfortunately redoing this series in that pattern would take a couple hours.  Here is the patch in -w form:

iff --git a/mercurial/verify.py b/mercurial/verify.py

Patch

--- a/mercurial/verify.py

+++ b/mercurial/verify.py

@@ -24,7 +24,7 @@  from . import (

 def verify(repo):
     lock = repo.lock()
     try:
-        return _verify(repo)

+        return verifier().verify(repo)

     finally:
         lock.release()

@@ -46,7 +46,8 @@  def _validpath(repo, path):

     """
     return True

-def _verify(repo):

+class verifier(object):

+    def verify(self, repo):

     repo = repo.unfiltered()
     mflinkrevs = {}
     filelinkrevs = {}
@@ -316,8 +317,8 @@  def _verify(repo):

                                    " in parents of %s") % (f, ctx))
                     fl2 = repo.file(rp[0])
                     if not len(fl2):
-                        err(lr, _("empty or missing copy source revlog %s:%s")

-                            % (rp[0], short(rp[1])), f)

+                            err(lr, _("empty or missing copy source revlog "

_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@selenic.com
https://selenic.com/mailman/listinfo/mercurial-devel