hg diff [OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]...

показать изменения в хранилище (или выбранных файлах)

Show differences between revisions for the specified files.

Differences between files are shown using the unified diff format.

.. note::

   :hg:`diff` may generate unexpected results for merges, as it will
   default to comparing against the working directory's first
   parent changeset if no revisions are specified.  To diff against the
   conflict regions, you can use `--config diff.merge=yes`.

By default, the working directory files are compared to its first parent. To
see the differences from another revision, use --from. To see the difference
to another revision, use --to. For example, :hg:`diff --from .^` will show
the differences from the working copy's grandparent to the working copy,
:hg:`diff --to .` will show the diff from the working copy to its parent
(i.e. the reverse of the default), and :hg:`diff --from 1.0 --to 1.2` will
show the diff between those two revisions.

Alternatively you can specify -c/--change with a revision to see the changes
in that changeset relative to its first parent (i.e. :hg:`diff -c 42` is
equivalent to :hg:`diff --from 42^ --to 42`)

Without the -a/--text option, diff will avoid generating diffs of
files it detects as binary. With -a, diff will generate a diff
anyway, probably with undesirable results.

Use the -g/--git option to generate diffs in the git extended diff
format. For more information, read :hg:`help diffs`.

.. container:: verbose

  Examples:

  - compare a file in the current working directory to its parent::

      hg diff foo.c

  - compare two historical versions of a directory, with rename info::

      hg diff --git --from 1.0 --to 1.2 lib/

  - get change stats relative to the last change on some date::

      hg diff --stat --from "date('may 2')"

  - diff all newly-added files that contain a keyword::

      hg diff "set:added() and grep(GNU)"

  - compare a revision and its parents::

      hg diff -c 9353                  # compare against first parent
      hg diff --from 9353^ --to 9353   # same using revset syntax
      hg diff --from 9353^2 --to 9353  # compare against the second parent

Returns 0 on success.


options ([+] can be repeated):

 == =============================== ====================================================================
 -r --rev РЕВИЗИЯ [+]               revision (DEPRECATED)                                               
    --from REV1                     revision to diff from                                               
    --to REV2                       revision to diff to                                                 
 -c --change РЕВИЗИЯ                изменения, сделанные в ревизии                                      
    --ignore-changes-from-ancestors only compare the change made by the selected revision (EXPERIMENTAL)
 -a --text                          обрабатывать все файлы как текстовые                                
 -g --git                           use git extended diff format                                        
    --binary                        generate binary diffs in git mode (default)                         
    --nodates                       опускать даты в заголовках файлов различий                          
    --noprefix                      omit a/ and b/ prefixes from filenames                              
 -p --show-function                 show which function each change is in                               
    --reverse                       сгенерировать патч, который отменяет изменения                      
 -w --ignore-all-space              игнорировать пробельные символы при сравнении строк                 
 -b --ignore-space-change           игнорировать изменения в количестве пробельных символов             
 -B --ignore-blank-lines            игнорировать изменения, состоящие только из пустых строк            
 -Z --ignore-space-at-eol           ignore changes in whitespace at EOL                                 
 -U --unified КОЛ-ВО                показываемое количество строк контекста                             
    --stat                          отображать сводку изменений в стиле diffstat                        
    --root КАТАЛОГ                  produce diffs relative to subdirectory                              
 -I --include ШАБЛОН [+]            добавить файлы, имена которых соответствуют данным шаблонам         
 -X --exclude ШАБЛОН [+]            не добавлять файлы, имена которых соответствуют данным шаблонам     
 -S --subrepos                      рекурсивно обрабатывать подхранилища                                
 == =============================== ====================================================================

global options ([+] can be repeated):

 == ====================== =======================================================================================================================
 -R --repository ХРАНИЛИЩЕ корневой каталог хранилища или имя файла комплекта                                                                     
    --cwd КАТАЛОГ          сменить рабочий каталог                                                                                                
 -y --noninteractive       не спрашивать, на все вопросы автоматически выбирать первый вариант                                                    
 -q --quiet                подавлять вывод                                                                                                        
 -v --verbose              включить дополнительный вывод                                                                                          
    --color ТИП            when to colorize (boolean, always, auto, never, or debug)                                                              
    --config КОНФИГ [+]    задать/переопределить параметр конфигурации (в виде 'секция.параметр=значение')                                        
    --config-file HGRC [+] load config file to set/override config options                                                                        
    --debug                включить отладочный вывод                                                                                              
    --debugger             запустить отладчик                                                                                                     
    --encoding КОДИРОВКА   установить кодировку (по умолчанию: UTF-8)                                                                             
    --encodingmode РЕЖИМ   установить режим кодировки (по умолчанию: strict)                                                                      
    --traceback            всегда печатать трассировку стека при исключении                                                                       
    --time                 время выполнения команды                                                                                               
    --profile              профилирование выполнения команды                                                                                      
    --version              напечатать информацию о версии и выйти                                                                                 
 -h --help                 показать справку и выйти                                                                                               
    --hidden               учитывать скрытые наборы изменений                                                                                     
    --pager ТИП            когда использовать прокрутку (логический. always (всегда), auto(автоматически) или never (никогда) (по умолчанию: auto)
 == ====================== =======================================================================================================================