diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2916,6 +2916,8 @@ table = { _('ignore changes in the amount of white space')), ('B', 'ignore-blank-lines', None, _('ignore changes whose lines are all blank')), + ('U', 'unified', 3, + _('number of lines of context to show')) ] + walkopts, _('hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...')), "^export": diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1011,7 +1011,8 @@ def diffopts(ui, opts={}, untrusted=Fals showfunc=get('show_function', 'showfunc'), ignorews=get('ignore_all_space', 'ignorews'), ignorewsamount=get('ignore_space_change', 'ignorewsamount'), - ignoreblanklines=get('ignore_blank_lines', 'ignoreblanklines')) + ignoreblanklines=get('ignore_blank_lines', 'ignoreblanklines'), + context=get('unified')) def updatedir(ui, repo, patches): '''Update dirstate after patch application according to metadata''' diff --git a/tests/test-help.out b/tests/test-help.out --- a/tests/test-help.out +++ b/tests/test-help.out @@ -205,6 +205,7 @@ options: -w --ignore-all-space ignore white space when comparing lines -b --ignore-space-change ignore changes in the amount of white space -B --ignore-blank-lines ignore changes whose lines are all blank + -U --unified number of lines of context to show (default: 3) -I --include include names matching the given patterns -X --exclude exclude names matching the given patterns