Skip to content

Commit ea5bd9e

Browse files
zzl0facebook-github-bot
authored andcommitted
diff: deprecate xdir diff feature for diff command
Summary: This diff deprecate xdir diff feature for diff command. `subtree diff` is the recommended command for xdir diff feature. Reviewed By: muirdm Differential Revision: D67242555 fbshipit-source-id: 28cd041c2dc29ecf084fcef136a81fb53844f840
1 parent 855aa56 commit ea5bd9e

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

eden/scm/sapling/commands/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,11 @@ def diff(ui, repo, *pats, **opts):
21922192
21932193
Returns 0 on success.
21942194
"""
2195+
if opts.get("from_path") or opts.get("to_path"):
2196+
raise error.Abort(
2197+
_("'--from-path' and '--to-path' are deprecated for '@prog@ diff' command"),
2198+
hint=_("use '@prog@ subtree diff' to diff between directories"),
2199+
)
21952200

21962201
do_diff(ui, repo, *pats, **opts)
21972202

eden/scm/sapling/helptext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4683,7 +4683,7 @@
46834683
46844684
$ echo a > my-project/file
46854685
$ echo b > my-branch/file
4686-
$ @prog@ diff --from-path my-project --to-path my-branch
4686+
$ @prog@ subtree diff --from-path my-project --to-path my-branch
46874687
46884688
Files outside ``--from-path`` in the left side are ignored, and files
46894689
outside ``--to-path`` on the right side are ignored.
@@ -4706,5 +4706,5 @@
47064706
# Modify "file" in both branches and then diff both branches against "my-project":
47074707
$ echo branch1 > my-branch1/file
47084708
$ echo branch2 > my-branch2/file
4709-
$ @prog@ diff --from-path my-project --to-path my-branch1 --from-path my-project --to-path my-branch2
4709+
$ @prog@ subtree diff --from-path my-project --to-path my-branch1 --from-path my-project --to-path my-branch2
47104710
"""

eden/scm/tests/test-diff-xdir.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ validate from/to paths:
1919
abort: path 'foofoo' does not exist in commit 112bacaa6bb9
2020
[255]
2121

22+
diff command does not support xdir diff:
23+
$ hg diff -r $A -r $A --from-path foo --to-path bar
24+
abort: '--from-path' and '--to-path' are deprecated for 'hg diff' command
25+
(use 'hg subtree diff' to diff between directories)
26+
[255]
27+
2228
Basic diff with add, modify, and remove:
2329
$ hg subtree diff -r $A -r $A --from-path foo --to-path bar
2430
diff --git a/foo/differs b/bar/differs

0 commit comments

Comments
 (0)