mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
Move ui.diffopts to patch.diffopts where it belongs
This commit is contained in:
parent
b5a0f2743c
commit
6ecbc46d1a
@ -77,7 +77,7 @@ class queue:
|
||||
|
||||
def diffopts(self):
|
||||
if self._diffopts is None:
|
||||
self._diffopts = self.ui.diffopts()
|
||||
self._diffopts = patch.diffopts(self.ui)
|
||||
return self._diffopts
|
||||
|
||||
def join(self, *p):
|
||||
|
@ -1337,7 +1337,7 @@ def diff(ui, repo, *pats, **opts):
|
||||
fns, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
|
||||
|
||||
patch.diff(repo, node1, node2, fns, match=matchfn,
|
||||
opts=ui.diffopts(opts))
|
||||
opts=patch.diffopts(ui, opts))
|
||||
|
||||
def export(ui, repo, *changesets, **opts):
|
||||
"""dump the header and diffs for one or more changesets
|
||||
@ -1374,7 +1374,8 @@ def export(ui, repo, *changesets, **opts):
|
||||
else:
|
||||
ui.note(_('exporting patch:\n'))
|
||||
patch.export(repo, map(repo.lookup, revs), template=opts['output'],
|
||||
switch_parent=opts['switch_parent'], opts=ui.diffopts(opts))
|
||||
switch_parent=opts['switch_parent'],
|
||||
opts=patch.diffopts(ui, opts))
|
||||
|
||||
def forget(ui, repo, *pats, **opts):
|
||||
"""don't add the specified files on the next commit (DEPRECATED)
|
||||
|
@ -11,7 +11,7 @@ import os.path
|
||||
import mimetypes
|
||||
from mercurial.demandload import demandload
|
||||
demandload(globals(), "re zlib ConfigParser mimetools cStringIO sys tempfile")
|
||||
demandload(globals(), "mercurial:mdiff,ui,hg,util,archival,streamclone")
|
||||
demandload(globals(), "mercurial:mdiff,ui,hg,util,archival,streamclone,patch")
|
||||
demandload(globals(), "mercurial:templater")
|
||||
demandload(globals(), "mercurial.hgweb.common:get_mtime,staticfile")
|
||||
from mercurial.node import *
|
||||
@ -134,7 +134,7 @@ class hgweb(object):
|
||||
modified, added, removed = map(lambda x: filterfiles(files, x),
|
||||
(modified, added, removed))
|
||||
|
||||
diffopts = ui.diffopts()
|
||||
diffopts = patch.diffopts(ui)
|
||||
for f in modified:
|
||||
to = r.file(f).read(mmap1[f])
|
||||
tn = r.file(f).read(mmap2[f])
|
||||
|
@ -251,6 +251,18 @@ def patch(strip, patchname, ui, cwd=None):
|
||||
|
||||
return files
|
||||
|
||||
def diffopts(ui, opts={}):
|
||||
return mdiff.diffopts(
|
||||
text=opts.get('text'),
|
||||
showfunc=(opts.get('show_function') or
|
||||
ui.configbool('diff', 'showfunc', None)),
|
||||
ignorews=(opts.get('ignore_all_space') or
|
||||
ui.configbool('diff', 'ignorews', None)),
|
||||
ignorewsamount=(opts.get('ignore_space_change') or
|
||||
ui.configbool('diff', 'ignorewsamount', None)),
|
||||
ignoreblanklines=(opts.get('ignore_blank_lines') or
|
||||
ui.configbool('diff', 'ignoreblanklines', None)))
|
||||
|
||||
def diff(repo, node1=None, node2=None, files=None, match=util.always,
|
||||
fp=None, changes=None, opts=None):
|
||||
'''print diff of changes to files between two nodes, or node and
|
||||
|
@ -169,18 +169,6 @@ class ui(object):
|
||||
result[key.lower()] = value
|
||||
return result
|
||||
|
||||
def diffopts(self, opts={}):
|
||||
return mdiff.diffopts(
|
||||
text=opts.get('text'),
|
||||
showfunc=(opts.get('show_function') or
|
||||
self.configbool('diff', 'showfunc', None)),
|
||||
ignorews=(opts.get('ignore_all_space') or
|
||||
self.configbool('diff', 'ignorews', None)),
|
||||
ignorewsamount=(opts.get('ignore_space_change') or
|
||||
self.configbool('diff', 'ignorewsamount', None)),
|
||||
ignoreblanklines=(opts.get('ignore_blank_lines') or
|
||||
self.configbool('diff', 'ignoreblanklines', None)))
|
||||
|
||||
def username(self):
|
||||
"""Return default username to be used in commits.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user