-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
localrepo: set files to empty for subtree shallow copy commits
Summary: For subtree shallow copy commit, we don't traverse the tree to find all the files. So the "files" list in the commit text will be empty for pure subtree shallow copy. Further more, we want to make the "files" list empty for any commits that contains subtree shallow copy, since the "files" list will not have all the changed files if the commit contains a shallow copy. Reviewed By: muirdm Differential Revision: D66193902 fbshipit-source-id: 3aaf5a95533112060fd52d6c69b2e2ba0c0efe7d
- Loading branch information
1 parent
4289d92
commit 5c212f2
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
$ setconfig diff.git=True | ||
$ setconfig subtree.copy-reuse-tree=True | ||
$ setconfig subtree.allow-any-source-commit=True | ||
|
||
test subtree copy | ||
$ newclientrepo | ||
$ drawdag <<'EOS' | ||
> B # B/foo/x = bbb\n | ||
> | | ||
> A # A/foo/x = aaa\n | ||
> # drawdag.defaultfiles=false | ||
> EOS | ||
$ hg go $B -q | ||
$ hg subtree cp -r $A --from-path foo --to-path bar -m "subtree copy foo -> bar" | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ hg dbsh -c 'print(repo["."].extra())' | ||
{'branch': 'default', 'test_subtree': '[{"copies":[{"from_commit":"d908813f0f7c9078810e26aad1e37bdb32013d4b","from_path":"foo","to_path":"bar"}],"v":1}]'} | ||
$ hg dbsh -c 'print(repo["."].changeset().files)' | ||
() | ||
|
||
files list is still empty after amending the shallow copy commit | ||
$ echo ccc >> bar/x | ||
$ hg amend | ||
$ hg dbsh -c 'print(repo["."].extra())' | ||
{'branch': 'default', 'amend_source': '075709eca377ab1f8a1e6a31b7970d26ff9ec935', 'test_subtree': '[{"copies":[{"from_commit":"d908813f0f7c9078810e26aad1e37bdb32013d4b","from_path":"foo","to_path":"bar"}],"v":1}]'} | ||
$ hg dbsh -c 'print(repo["."].changeset().files)' | ||
() | ||
$ hg dbsh -c 'print(repo["."].files())' | ||
['bar/x'] |