File: topic-diffs.html

package info (click to toggle)
mercurial 7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 45,084 kB
  • sloc: python: 208,593; ansic: 56,460; tcl: 3,715; sh: 1,839; lisp: 1,483; cpp: 864; makefile: 769; javascript: 649; xml: 36
file content (43 lines) | stat: -rw-r--r-- 2,169 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
<title>Diff Formats</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<div class="document" id="diff-formats">
<span id="topic-diffs"></span>
<h1 class="title">Diff Formats</h1>

<p id="diffs">Mercurial's default format for showing changes between two versions of
a file is compatible with the unified format of GNU diff, which can be
used by GNU patch and many other standard tools.</p>
<p>While this standard format is often enough, it does not encode the
following information:</p>
<ul class="simple">
<li>executable status and other permission bits</li>
<li>copy or rename information</li>
<li>changes in binary files</li>
<li>creation or deletion of empty files</li>
</ul>
<p>Mercurial also supports the extended diff format from the git VCS
which addresses these limitations. The git diff format is not produced
by default because a few widespread tools still do not understand this
format.</p>
<p>This means that when generating diffs from a Mercurial repository
(e.g. with <a class="reference external" href="hg-export.html"><tt class="docutils literal">hg export</tt></a>), you should be careful about things like file
copies and renames or other things mentioned above, because when
applying a standard diff to a different repository, this extra
information is lost. Mercurial's internal operations (like push and
pull) are not affected by this, because they use an internal binary
format for communicating changes.</p>
<p>To make Mercurial produce the git extended diff format, use the --git
option available for many commands, or set 'git = True' in the [diff]
section of your configuration file. You do not need to set this option
when importing diffs in this format or using them in the mq extension.</p>
</div>
</body>
</html>