Skip to content
Snippets Groups Projects
Commit 597ddcb4 authored by Matt Harbison's avatar Matt Harbison
Browse files

largefiles: notice dirty large files in a subrepo

Summary and commit use dirty() to check the status of a subrepository,
so this overrides dirty() in the subrepo in the same manner as
status() to check the large files instead of their standins.

Previously, if only a large file was changed in a subrepo, summary in
the top level repo would not report the subrepo was dirty and commit
-S would report nothing changed.  If any type of file was changed in
the top repo and only a large file in the subrepo, commit -S would not
commit the changes to the subrepo.
parent 12dabc22
No related branches found
No related tags found
No related merge requests found
......@@ -216,6 +216,13 @@
finally:
repo.lfstatus = False
def overridedirty(orig, repo, ignoreupdate=False):
try:
repo._repo.lfstatus = True
return orig(repo, ignoreupdate)
finally:
repo._repo.lfstatus = False
def overridelog(orig, ui, repo, *pats, **opts):
try:
repo.lfstatus = True
......
......@@ -81,6 +81,10 @@
entry = extensions.wrapfunction(cmdutil, 'copy',
overrides.overridecopy)
# Summary calls dirty on the subrepos
entry = extensions.wrapfunction(hgsubrepo, 'dirty',
overrides.overridedirty)
# Backout calls revert so we need to override both the command and the
# function
entry = extensions.wrapcommand(commands.table, 'revert',
......
......@@ -1060,6 +1060,12 @@
? .hgsubstate
$ echo "rev 1" > subrepo/large.txt
$ hg -R subrepo add --large subrepo/large.txt
$ hg sum
parent: 1:8ee150ea2e9c tip
add subrepo
branch: default
commit: 1 subrepos
update: (current)
$ hg st
$ hg st -S
A subrepo/large.txt
......@@ -1063,7 +1069,7 @@
$ hg st
$ hg st -S
A subrepo/large.txt
# This is a workaround for not noticing the subrepo is dirty
$ hg -R subrepo ci -m "commit large file"
$ hg ci -S -m "commit top repo"
committing subrepository subrepo
Invoking status precommit hook
A large.txt
......@@ -1068,5 +1074,4 @@
Invoking status precommit hook
A large.txt
$ hg ci -S -m "commit top repo"
Invoking status precommit hook
M .hgsubstate
......@@ -1071,3 +1076,4 @@
Invoking status precommit hook
M .hgsubstate
# No differences
$ hg st -S
......@@ -1073,4 +1079,10 @@
$ hg st -S
$ hg sum
parent: 2:ce4cd0c527a6 tip
commit top repo
branch: default
commit: (clean)
update: (current)
$ echo "rev 2" > subrepo/large.txt
$ hg st -S
M subrepo/large.txt
......@@ -1074,5 +1086,14 @@
$ echo "rev 2" > subrepo/large.txt
$ hg st -S
M subrepo/large.txt
$ hg sum
parent: 2:ce4cd0c527a6 tip
commit top repo
branch: default
commit: 1 subrepos
update: (current)
$ hg ci -m "this commit should fail without -S"
abort: uncommitted changes in subrepo subrepo
(use --subrepos for recursive commit)
[255]
$ cd ..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment