Patchwork [02,of,12] mdiff: move re-exports to top

login
register
mail settings
Submitter Yuya Nishihara
Date May 7, 2017, 1:45 a.m.
Message ID <9151ab042bb7e3001d0a.1494121543@mimosa>
Download mbox | patch
Permalink /patch/20500/
State Accepted
Headers show

Comments

Yuya Nishihara - May 7, 2017, 1:45 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1493712322 -32400
#      Tue May 02 17:05:22 2017 +0900
# Node ID 9151ab042bb7e3001d0a2a4fdb8f435928504d36
# Parent  ce67363f32a3b8d1ade7be8f18a18a87aa267d03
mdiff: move re-exports to top

This style seems more common in our codebase.

Patch

diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -21,6 +21,10 @@  from . import (
     util,
 )
 
+patches = mpatch.patches
+patchedsize = mpatch.patchedsize
+textdiff = bdiff.bdiff
+
 def splitnewlines(text):
     '''like str.splitlines, but only split on newlines.'''
     lines = [l + '\n' for l in text.split('\n')]
@@ -478,7 +482,3 @@  def trivialdiffheader(length):
 
 def replacediffheader(oldlen, newlen):
     return struct.pack(">lll", 0, oldlen, newlen)
-
-patches = mpatch.patches
-patchedsize = mpatch.patchedsize
-textdiff = bdiff.bdiff