equal
deleted
inserted
replaced
151 if not cmd.startswith('cmd.'): continue |
151 if not cmd.startswith('cmd.'): continue |
152 cmd = cmd[4:] |
152 cmd = cmd[4:] |
153 if not path: path = cmd |
153 if not path: path = cmd |
154 diffopts = ui.config('extdiff', 'opts.' + cmd, '') |
154 diffopts = ui.config('extdiff', 'opts.' + cmd, '') |
155 diffopts = diffopts and [diffopts] or [] |
155 diffopts = diffopts and [diffopts] or [] |
156 def save(cmd, path): |
156 def save(cmd, path, diffopts): |
157 '''use closure to save diff command to use''' |
157 '''use closure to save diff command to use''' |
158 def mydiff(ui, repo, *pats, **opts): |
158 def mydiff(ui, repo, *pats, **opts): |
159 return dodiff(ui, repo, path, diffopts, pats, opts) |
159 return dodiff(ui, repo, path, diffopts, pats, opts) |
160 mydiff.__doc__ = '''use %(path)r to diff repository (or selected files) |
160 mydiff.__doc__ = '''use %(path)r to diff repository (or selected files) |
161 |
161 |
168 directory, and, when no revisions are specified, the |
168 directory, and, when no revisions are specified, the |
169 working directory files are compared to its parent.''' % { |
169 working directory files are compared to its parent.''' % { |
170 'path': path, |
170 'path': path, |
171 } |
171 } |
172 return mydiff |
172 return mydiff |
173 cmdtable[cmd] = (save(cmd, path), |
173 cmdtable[cmd] = (save(cmd, path, diffopts), |
174 cmdtable['extdiff'][1][1:], |
174 cmdtable['extdiff'][1][1:], |
175 _('hg %s [OPT]... [FILE]...') % cmd) |
175 _('hg %s [OPT]... [FILE]...') % cmd) |