largefiles: use "normallookup", if "mtime" of standin is unset
Before this patch, largefiles gotten from "other" revision (without
conflict) at "hg merge" become "clean" unexpectedly in steps below:
1. "merge.update()" is invoked
1-1 standinfile SF is updated in the working directory
1-2 "dirstate" entry for SF is "normallookup"-ed
2. "lfcommands.updatelfiles()" is invoked (by "overrides.hgmerge()")
2-1 largefile LF (for SF) is updated in the working directory
2-2 "dirstate" returns "n" for SF (by 1-2)
2-3 "lfdirstate" entry for LF is "normal"-ed
2-4 "lfdirstate" is written into ".hg/largefiles/dirstate", and
timestamp of LF is stored into "lfdirstate" file
(ASSUMPTION: timestamp of LF differs from one of "lfdirstate" file)
Then, "hs status" treats LF as "clean", even though LF is updated by
"other" revision (by 2-1), because "lfilesrepo.status()" always treats
"normal"-ed files (by 2-3 and 2-4) as "clean".
When timestamp is not set (= negative value) for standinfile in
"dirstate", largefile should be "normallookup"-ed regardless of
rebasing or not, because "n" state in "dirstate" doesn't ensure
"clean"-ness of a standinfile at that time.
This patch uses "normallookup" instead of "normal", if "mtime" of
standin is unset
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, "lfdirstate" should
be updated with "dirstate" simultaneously while "merge.update"
execution: maybe by hooking "recordupdates"
It is also why this patch (temporarily) uses internal field "_map" of
"dirstate" directly.
This patch uses "[debug] dirstate.delaywrite" feature in the test, to
ensure that timestamp of the largefile gotten from "other" revision is
stored into ".hg/largefiles/dirstate". (for ASSUMPTION at 2-4)
This patch newly adds "test-largefiles-update.t", to avoid increasing
cost to run other tests for largefiles by subsequent patches
(especially, "[debug] dirstate.delaywrite" causes so).
2014-07-22 18:59:34 +04:00
|
|
|
This file focuses mainly on updating largefiles in the working
|
|
|
|
directory (and ".hg/largefiles/dirstate")
|
|
|
|
|
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [ui]
|
|
|
|
> merge = internal:fail
|
|
|
|
> [extensions]
|
|
|
|
> largefiles =
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
|
|
|
|
$ echo large1 > large1
|
|
|
|
$ echo large2 > large2
|
|
|
|
$ hg add --large large1 large2
|
|
|
|
$ echo normal1 > normal1
|
|
|
|
$ hg add normal1
|
|
|
|
$ hg commit -m '#0'
|
|
|
|
$ echo 'large1 in #1' > large1
|
|
|
|
$ echo 'normal1 in #1' > normal1
|
|
|
|
$ hg commit -m '#1'
|
|
|
|
$ hg update -q -C 0
|
|
|
|
$ echo 'large2 in #2' > large2
|
|
|
|
$ hg commit -m '#2'
|
|
|
|
created new head
|
|
|
|
|
|
|
|
Test that "hg merge" updates largefiles from "other" correctly
|
|
|
|
|
|
|
|
(getting largefiles from "other" normally)
|
|
|
|
|
|
|
|
$ hg status -A large1
|
|
|
|
C large1
|
|
|
|
$ cat large1
|
|
|
|
large1
|
|
|
|
$ cat .hglf/large1
|
|
|
|
4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
$ hg merge --config debug.dirstate.delaywrite=2
|
|
|
|
getting changed largefiles
|
|
|
|
1 largefiles updated, 0 removed
|
largefiles: update largefiles even if rebase is aborted by conflict
Before this patch, largefiles in the working directory aren't updated
correctly, if rebase is aborted by conflict. This prevents users from
viewing appropriate largefiles while resolving conflicts.
While rebase, largefiles in the working directory are updated only at
successful committing in the special code path of
"lfilesrepo.commit()".
To update largefiles even if rebase is aborted by conflict, this patch
centralizes the logic of updating largefiles in the working directory
into the "mergeupdate" wrapping "merge.update".
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, largefiles in the
working directory should be updated with other (normal) files
simultaneously while "merge.update" execution: maybe by hooking
"applyupdates".
"Action list based updating" introduced by hooking "applyupdates" will
also improve performance of updating, because it automatically
decreases target files to be checked.
Just after this patch, there are some improper things in "Case 0" code
path of "lfilesrepo.commit()":
- "updatelfiles" invocation is redundant for rebase
- detailed comment doesn't meet to rebase behavior
These will be resolved after the subsequent patch for transplant,
because this code path is shared with transplant.
Even though replacing "merge.update" in rebase extension by "hg.merge"
can also avoid this problem, this patch chooses centralizing the logic
into "mergeupdate", because:
- "merge.update" invocation in rebase extension can't be directly
replaced by "hg.merge", because:
- rebase requires some extra arguments, which "hg.merge" doesn't
take (e.g. "ancestor")
- rebase doesn't require statistics information forcibly displayed
in "hg.merge"
- introducing "mergeupdate" can resolve also problem of some other
code paths directly using "merge.update"
largefiles in the working directory aren't updated regardless of
the result of commands below, before this patch:
- backout (for revisions other than the parent revision of the
working directory without "--merge")
- graft
- histedit (for revisions other than the parent of the working
directory
When "partial" is specified, "merge.update" doesn't update dirstate
entries for standins, even though standins themselves are updated.
In this case, "normallookup" should be used to mark largefiles as
"possibly dirty" forcibly, because applying "normal" on lfdirstate
treats them as "clean" unexpectedly.
This is reason why "normallookup=partial" is specified for
"lfcommands.updatelfiles".
This patch doesn't test "hg rebase --continue", because it doesn't
work correctly if largefiles in the working directory are modified
manually while resolving conflicts. This will be fixed in the next
step of refactoring for largefiles.
All changes of tests/*.t files other than test-largefiles-update.t in
this patch come from invoking "updatelfiles" not after but before
statistics output of "hg.update", "hg.clean" and "hg.merge".
2014-08-24 18:47:26 +04:00
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
largefiles: use "normallookup", if "mtime" of standin is unset
Before this patch, largefiles gotten from "other" revision (without
conflict) at "hg merge" become "clean" unexpectedly in steps below:
1. "merge.update()" is invoked
1-1 standinfile SF is updated in the working directory
1-2 "dirstate" entry for SF is "normallookup"-ed
2. "lfcommands.updatelfiles()" is invoked (by "overrides.hgmerge()")
2-1 largefile LF (for SF) is updated in the working directory
2-2 "dirstate" returns "n" for SF (by 1-2)
2-3 "lfdirstate" entry for LF is "normal"-ed
2-4 "lfdirstate" is written into ".hg/largefiles/dirstate", and
timestamp of LF is stored into "lfdirstate" file
(ASSUMPTION: timestamp of LF differs from one of "lfdirstate" file)
Then, "hs status" treats LF as "clean", even though LF is updated by
"other" revision (by 2-1), because "lfilesrepo.status()" always treats
"normal"-ed files (by 2-3 and 2-4) as "clean".
When timestamp is not set (= negative value) for standinfile in
"dirstate", largefile should be "normallookup"-ed regardless of
rebasing or not, because "n" state in "dirstate" doesn't ensure
"clean"-ness of a standinfile at that time.
This patch uses "normallookup" instead of "normal", if "mtime" of
standin is unset
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, "lfdirstate" should
be updated with "dirstate" simultaneously while "merge.update"
execution: maybe by hooking "recordupdates"
It is also why this patch (temporarily) uses internal field "_map" of
"dirstate" directly.
This patch uses "[debug] dirstate.delaywrite" feature in the test, to
ensure that timestamp of the largefile gotten from "other" revision is
stored into ".hg/largefiles/dirstate". (for ASSUMPTION at 2-4)
This patch newly adds "test-largefiles-update.t", to avoid increasing
cost to run other tests for largefiles by subsequent patches
(especially, "[debug] dirstate.delaywrite" causes so).
2014-07-22 18:59:34 +04:00
|
|
|
$ hg status -A large1
|
|
|
|
M large1
|
|
|
|
$ cat large1
|
|
|
|
large1 in #1
|
|
|
|
$ cat .hglf/large1
|
|
|
|
58e24f733a964da346e2407a2bee99d9001184f5
|
|
|
|
$ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
|
|
|
|
-4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
+58e24f733a964da346e2407a2bee99d9001184f5
|
|
|
|
|
2014-07-22 19:10:24 +04:00
|
|
|
(getting largefiles from "other" via conflict prompt)
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ echo 'large1 in #3' > large1
|
|
|
|
$ echo 'normal1 in #3' > normal1
|
|
|
|
$ hg commit -m '#3'
|
|
|
|
$ cat .hglf/large1
|
|
|
|
e5bb990443d6a92aaf7223813720f7566c9dd05b
|
|
|
|
$ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
|
|
|
|
> o
|
|
|
|
> EOF
|
|
|
|
largefile large1 has a merge conflict
|
|
|
|
ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
|
2014-10-01 03:04:18 +04:00
|
|
|
take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
|
|
|
|
merging normal1
|
2014-07-22 19:10:24 +04:00
|
|
|
warning: conflicts during merge.
|
|
|
|
merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
|
|
|
|
getting changed largefiles
|
|
|
|
1 largefiles updated, 0 removed
|
largefiles: update largefiles even if rebase is aborted by conflict
Before this patch, largefiles in the working directory aren't updated
correctly, if rebase is aborted by conflict. This prevents users from
viewing appropriate largefiles while resolving conflicts.
While rebase, largefiles in the working directory are updated only at
successful committing in the special code path of
"lfilesrepo.commit()".
To update largefiles even if rebase is aborted by conflict, this patch
centralizes the logic of updating largefiles in the working directory
into the "mergeupdate" wrapping "merge.update".
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, largefiles in the
working directory should be updated with other (normal) files
simultaneously while "merge.update" execution: maybe by hooking
"applyupdates".
"Action list based updating" introduced by hooking "applyupdates" will
also improve performance of updating, because it automatically
decreases target files to be checked.
Just after this patch, there are some improper things in "Case 0" code
path of "lfilesrepo.commit()":
- "updatelfiles" invocation is redundant for rebase
- detailed comment doesn't meet to rebase behavior
These will be resolved after the subsequent patch for transplant,
because this code path is shared with transplant.
Even though replacing "merge.update" in rebase extension by "hg.merge"
can also avoid this problem, this patch chooses centralizing the logic
into "mergeupdate", because:
- "merge.update" invocation in rebase extension can't be directly
replaced by "hg.merge", because:
- rebase requires some extra arguments, which "hg.merge" doesn't
take (e.g. "ancestor")
- rebase doesn't require statistics information forcibly displayed
in "hg.merge"
- introducing "mergeupdate" can resolve also problem of some other
code paths directly using "merge.update"
largefiles in the working directory aren't updated regardless of
the result of commands below, before this patch:
- backout (for revisions other than the parent revision of the
working directory without "--merge")
- graft
- histedit (for revisions other than the parent of the working
directory
When "partial" is specified, "merge.update" doesn't update dirstate
entries for standins, even though standins themselves are updated.
In this case, "normallookup" should be used to mark largefiles as
"possibly dirty" forcibly, because applying "normal" on lfdirstate
treats them as "clean" unexpectedly.
This is reason why "normallookup=partial" is specified for
"lfcommands.updatelfiles".
This patch doesn't test "hg rebase --continue", because it doesn't
work correctly if largefiles in the working directory are modified
manually while resolving conflicts. This will be fixed in the next
step of refactoring for largefiles.
All changes of tests/*.t files other than test-largefiles-update.t in
this patch come from invoking "updatelfiles" not after but before
statistics output of "hg.update", "hg.clean" and "hg.merge".
2014-08-24 18:47:26 +04:00
|
|
|
0 files updated, 1 files merged, 0 files removed, 1 files unresolved
|
|
|
|
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
|
2014-07-22 19:10:24 +04:00
|
|
|
[1]
|
|
|
|
$ hg status -A large1
|
|
|
|
M large1
|
|
|
|
$ cat large1
|
|
|
|
large1 in #1
|
|
|
|
$ cat .hglf/large1
|
|
|
|
58e24f733a964da346e2407a2bee99d9001184f5
|
|
|
|
|
2014-07-22 19:10:24 +04:00
|
|
|
Test that "hg revert -r REV" updates largefiles from "REV" correctly
|
|
|
|
|
|
|
|
$ hg update -q -C 3
|
|
|
|
$ hg status -A large1
|
|
|
|
C large1
|
|
|
|
$ cat large1
|
|
|
|
large1 in #3
|
|
|
|
$ cat .hglf/large1
|
|
|
|
e5bb990443d6a92aaf7223813720f7566c9dd05b
|
|
|
|
$ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
|
|
|
|
-4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
+58e24f733a964da346e2407a2bee99d9001184f5
|
|
|
|
$ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
|
|
|
|
$ hg status -A large1
|
|
|
|
M large1
|
|
|
|
$ cat large1
|
|
|
|
large1 in #1
|
|
|
|
$ cat .hglf/large1
|
|
|
|
58e24f733a964da346e2407a2bee99d9001184f5
|
|
|
|
|
2014-08-11 17:29:43 +04:00
|
|
|
Test that "hg rollback" restores status of largefiles correctly
|
|
|
|
|
|
|
|
$ hg update -C -q
|
|
|
|
$ hg remove large1
|
2014-08-24 18:47:25 +04:00
|
|
|
$ test -f .hglf/large1
|
|
|
|
[1]
|
2014-08-11 17:29:43 +04:00
|
|
|
$ hg forget large2
|
2014-08-24 18:47:25 +04:00
|
|
|
$ test -f .hglf/large2
|
|
|
|
[1]
|
2014-08-11 17:29:43 +04:00
|
|
|
$ echo largeX > largeX
|
|
|
|
$ hg add --large largeX
|
2014-08-24 18:47:25 +04:00
|
|
|
$ cat .hglf/largeX
|
|
|
|
|
2014-08-11 17:29:43 +04:00
|
|
|
$ hg commit -m 'will be rollback-ed soon'
|
2014-08-11 17:29:43 +04:00
|
|
|
$ echo largeY > largeY
|
|
|
|
$ hg add --large largeY
|
2014-10-20 17:08:08 +04:00
|
|
|
#if windows
|
|
|
|
$ hg status -A large1
|
|
|
|
large1: * (glob)
|
|
|
|
#else
|
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A large1
|
|
|
|
large1: No such file or directory
|
2014-10-20 17:08:08 +04:00
|
|
|
#endif
|
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A large2
|
|
|
|
? large2
|
|
|
|
$ hg status -A largeX
|
|
|
|
C largeX
|
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A largeY
|
|
|
|
A largeY
|
2014-08-11 17:29:43 +04:00
|
|
|
$ hg rollback
|
|
|
|
repository tip rolled back to revision 3 (undo commit)
|
|
|
|
working directory now based on revision 3
|
|
|
|
$ hg status -A large1
|
|
|
|
R large1
|
2014-08-24 18:47:25 +04:00
|
|
|
$ test -f .hglf/large1
|
|
|
|
[1]
|
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A large2
|
|
|
|
R large2
|
2014-08-24 18:47:25 +04:00
|
|
|
$ test -f .hglf/large2
|
|
|
|
[1]
|
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A largeX
|
|
|
|
A largeX
|
2014-08-24 18:47:25 +04:00
|
|
|
$ cat .hglf/largeX
|
|
|
|
|
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A largeY
|
|
|
|
? largeY
|
2014-08-24 18:47:26 +04:00
|
|
|
$ test -f .hglf/largeY
|
|
|
|
[1]
|
2014-08-11 17:29:43 +04:00
|
|
|
|
2014-08-24 18:47:25 +04:00
|
|
|
Test that "hg rollback" restores standins correctly
|
|
|
|
|
|
|
|
$ hg commit -m 'will be rollback-ed soon'
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ cat large1
|
|
|
|
large1
|
|
|
|
$ cat .hglf/large1
|
|
|
|
4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
$ cat large2
|
|
|
|
large2 in #2
|
|
|
|
$ cat .hglf/large2
|
|
|
|
3cfce6277e7668985707b6887ce56f9f62f6ccd9
|
|
|
|
|
|
|
|
$ hg rollback -q -f
|
|
|
|
$ cat large1
|
|
|
|
large1
|
|
|
|
$ cat .hglf/large1
|
|
|
|
4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
$ cat large2
|
|
|
|
large2 in #2
|
|
|
|
$ cat .hglf/large2
|
|
|
|
3cfce6277e7668985707b6887ce56f9f62f6ccd9
|
|
|
|
|
2014-08-24 18:47:25 +04:00
|
|
|
(rollback the parent of the working directory, when the parent of it
|
|
|
|
is not branch-tip)
|
|
|
|
|
|
|
|
$ hg update -q -C 1
|
|
|
|
$ cat .hglf/large1
|
|
|
|
58e24f733a964da346e2407a2bee99d9001184f5
|
|
|
|
$ cat .hglf/large2
|
|
|
|
1deebade43c8c498a3c8daddac0244dc55d1331d
|
|
|
|
|
|
|
|
$ echo normalX > normalX
|
|
|
|
$ hg add normalX
|
|
|
|
$ hg commit -m 'will be rollback-ed soon'
|
|
|
|
$ hg rollback -q
|
|
|
|
|
|
|
|
$ cat .hglf/large1
|
|
|
|
58e24f733a964da346e2407a2bee99d9001184f5
|
|
|
|
$ cat .hglf/large2
|
|
|
|
1deebade43c8c498a3c8daddac0244dc55d1331d
|
|
|
|
|
largefiles: synchronize lfdirstate with dirstate after automated committing
Before this patch, after successful "hg rebase" of the revision
removing largefiles, "hg status" may still show ""R" for such
largefiles unexpectedly.
"lfilesrepo.commit" executes the special code path for automated
committing while rebase/transplant, and lfdirstate entries for removed
files aren't updated in this code path, even after successful
committing.
Then, "R" entries still existing in lfdirstate cause unexpected "hg
status" output.
This patch synchronizes lfdirstate with dirstate after automated
committing.
This patch passes False as "normallookup" to "synclfdirstate", because
modified files in "files()" of the recent (= just committed) context
should be "normal"-ed.
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, lfdirstate should
be updated with dirstate simultaneously. Hooking "markcommitted" of
ctx in "localrepository.commitctx" may achieve this.
This problem occurs, only when (1) the parent of the working directory
is rebased and (2) it removes largefiles, because:
- if the parent of the working directory isn't rebased, returning to
the initial revision (= update) after rebase hides this problem
- files added on "other" branch (= rebase target) are treated not as
"added" but as "modified" (= "normal" status and "unset"
timestamp) at merging
This patch tests also the status of added largefile, but it is only
for avoiding regression.
In addition to conditions above, "hg status" must not take existing
files to reproduce this problem, because existing files make
"match._files" not empty in "lfilesrepo.status" code path below:
def sfindirstate(f):
sf = lfutil.standin(f)
dirstate = self.dirstate
return sf in dirstate or sf in dirstate.dirs()
match._files = [f for f in match._files
if sfindirstate(f)]
Not empty "match._files" prevents "status" on lfdirstate from
returning the result containing problematic "R" files.
This is reason why "large1" (removed) and "largeX" (added) are checked
separately in this patch.
Problematic code path in "lfilesrepo.commit" is used also by "hg
transplant", but this problem doesn't occur at "hg transplant",
because invocation of "updatelfiles" after transplant-ing in
"overridetransplant" causes cleaning lfdirstate up.
This patch tests also "hg transplant" as same as "hg rebase", but it
is only for avoiding regression.
2014-08-11 17:29:43 +04:00
|
|
|
Test that "hg status" shows status of largefiles correctly just after
|
|
|
|
automated commit like rebase/transplant
|
|
|
|
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> rebase =
|
|
|
|
> strip =
|
|
|
|
> transplant =
|
|
|
|
> EOF
|
|
|
|
$ hg update -q -C 1
|
|
|
|
$ hg remove large1
|
|
|
|
$ echo largeX > largeX
|
|
|
|
$ hg add --large largeX
|
|
|
|
$ hg commit -m '#4'
|
|
|
|
|
|
|
|
$ hg rebase -s 1 -d 2 --keep
|
2014-10-20 17:08:08 +04:00
|
|
|
#if windows
|
|
|
|
$ hg status -A large1
|
|
|
|
large1: * (glob)
|
|
|
|
#else
|
largefiles: synchronize lfdirstate with dirstate after automated committing
Before this patch, after successful "hg rebase" of the revision
removing largefiles, "hg status" may still show ""R" for such
largefiles unexpectedly.
"lfilesrepo.commit" executes the special code path for automated
committing while rebase/transplant, and lfdirstate entries for removed
files aren't updated in this code path, even after successful
committing.
Then, "R" entries still existing in lfdirstate cause unexpected "hg
status" output.
This patch synchronizes lfdirstate with dirstate after automated
committing.
This patch passes False as "normallookup" to "synclfdirstate", because
modified files in "files()" of the recent (= just committed) context
should be "normal"-ed.
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, lfdirstate should
be updated with dirstate simultaneously. Hooking "markcommitted" of
ctx in "localrepository.commitctx" may achieve this.
This problem occurs, only when (1) the parent of the working directory
is rebased and (2) it removes largefiles, because:
- if the parent of the working directory isn't rebased, returning to
the initial revision (= update) after rebase hides this problem
- files added on "other" branch (= rebase target) are treated not as
"added" but as "modified" (= "normal" status and "unset"
timestamp) at merging
This patch tests also the status of added largefile, but it is only
for avoiding regression.
In addition to conditions above, "hg status" must not take existing
files to reproduce this problem, because existing files make
"match._files" not empty in "lfilesrepo.status" code path below:
def sfindirstate(f):
sf = lfutil.standin(f)
dirstate = self.dirstate
return sf in dirstate or sf in dirstate.dirs()
match._files = [f for f in match._files
if sfindirstate(f)]
Not empty "match._files" prevents "status" on lfdirstate from
returning the result containing problematic "R" files.
This is reason why "large1" (removed) and "largeX" (added) are checked
separately in this patch.
Problematic code path in "lfilesrepo.commit" is used also by "hg
transplant", but this problem doesn't occur at "hg transplant",
because invocation of "updatelfiles" after transplant-ing in
"overridetransplant" causes cleaning lfdirstate up.
This patch tests also "hg transplant" as same as "hg rebase", but it
is only for avoiding regression.
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A large1
|
|
|
|
large1: No such file or directory
|
2014-10-20 17:08:08 +04:00
|
|
|
#endif
|
largefiles: synchronize lfdirstate with dirstate after automated committing
Before this patch, after successful "hg rebase" of the revision
removing largefiles, "hg status" may still show ""R" for such
largefiles unexpectedly.
"lfilesrepo.commit" executes the special code path for automated
committing while rebase/transplant, and lfdirstate entries for removed
files aren't updated in this code path, even after successful
committing.
Then, "R" entries still existing in lfdirstate cause unexpected "hg
status" output.
This patch synchronizes lfdirstate with dirstate after automated
committing.
This patch passes False as "normallookup" to "synclfdirstate", because
modified files in "files()" of the recent (= just committed) context
should be "normal"-ed.
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, lfdirstate should
be updated with dirstate simultaneously. Hooking "markcommitted" of
ctx in "localrepository.commitctx" may achieve this.
This problem occurs, only when (1) the parent of the working directory
is rebased and (2) it removes largefiles, because:
- if the parent of the working directory isn't rebased, returning to
the initial revision (= update) after rebase hides this problem
- files added on "other" branch (= rebase target) are treated not as
"added" but as "modified" (= "normal" status and "unset"
timestamp) at merging
This patch tests also the status of added largefile, but it is only
for avoiding regression.
In addition to conditions above, "hg status" must not take existing
files to reproduce this problem, because existing files make
"match._files" not empty in "lfilesrepo.status" code path below:
def sfindirstate(f):
sf = lfutil.standin(f)
dirstate = self.dirstate
return sf in dirstate or sf in dirstate.dirs()
match._files = [f for f in match._files
if sfindirstate(f)]
Not empty "match._files" prevents "status" on lfdirstate from
returning the result containing problematic "R" files.
This is reason why "large1" (removed) and "largeX" (added) are checked
separately in this patch.
Problematic code path in "lfilesrepo.commit" is used also by "hg
transplant", but this problem doesn't occur at "hg transplant",
because invocation of "updatelfiles" after transplant-ing in
"overridetransplant" causes cleaning lfdirstate up.
This patch tests also "hg transplant" as same as "hg rebase", but it
is only for avoiding regression.
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A largeX
|
|
|
|
C largeX
|
|
|
|
$ hg strip -q 5
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ hg transplant -q 1 4
|
2014-10-20 17:08:08 +04:00
|
|
|
#if windows
|
|
|
|
$ hg status -A large1
|
|
|
|
large1: * (glob)
|
|
|
|
#else
|
largefiles: synchronize lfdirstate with dirstate after automated committing
Before this patch, after successful "hg rebase" of the revision
removing largefiles, "hg status" may still show ""R" for such
largefiles unexpectedly.
"lfilesrepo.commit" executes the special code path for automated
committing while rebase/transplant, and lfdirstate entries for removed
files aren't updated in this code path, even after successful
committing.
Then, "R" entries still existing in lfdirstate cause unexpected "hg
status" output.
This patch synchronizes lfdirstate with dirstate after automated
committing.
This patch passes False as "normallookup" to "synclfdirstate", because
modified files in "files()" of the recent (= just committed) context
should be "normal"-ed.
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, lfdirstate should
be updated with dirstate simultaneously. Hooking "markcommitted" of
ctx in "localrepository.commitctx" may achieve this.
This problem occurs, only when (1) the parent of the working directory
is rebased and (2) it removes largefiles, because:
- if the parent of the working directory isn't rebased, returning to
the initial revision (= update) after rebase hides this problem
- files added on "other" branch (= rebase target) are treated not as
"added" but as "modified" (= "normal" status and "unset"
timestamp) at merging
This patch tests also the status of added largefile, but it is only
for avoiding regression.
In addition to conditions above, "hg status" must not take existing
files to reproduce this problem, because existing files make
"match._files" not empty in "lfilesrepo.status" code path below:
def sfindirstate(f):
sf = lfutil.standin(f)
dirstate = self.dirstate
return sf in dirstate or sf in dirstate.dirs()
match._files = [f for f in match._files
if sfindirstate(f)]
Not empty "match._files" prevents "status" on lfdirstate from
returning the result containing problematic "R" files.
This is reason why "large1" (removed) and "largeX" (added) are checked
separately in this patch.
Problematic code path in "lfilesrepo.commit" is used also by "hg
transplant", but this problem doesn't occur at "hg transplant",
because invocation of "updatelfiles" after transplant-ing in
"overridetransplant" causes cleaning lfdirstate up.
This patch tests also "hg transplant" as same as "hg rebase", but it
is only for avoiding regression.
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A large1
|
|
|
|
large1: No such file or directory
|
2014-10-20 17:08:08 +04:00
|
|
|
#endif
|
largefiles: synchronize lfdirstate with dirstate after automated committing
Before this patch, after successful "hg rebase" of the revision
removing largefiles, "hg status" may still show ""R" for such
largefiles unexpectedly.
"lfilesrepo.commit" executes the special code path for automated
committing while rebase/transplant, and lfdirstate entries for removed
files aren't updated in this code path, even after successful
committing.
Then, "R" entries still existing in lfdirstate cause unexpected "hg
status" output.
This patch synchronizes lfdirstate with dirstate after automated
committing.
This patch passes False as "normallookup" to "synclfdirstate", because
modified files in "files()" of the recent (= just committed) context
should be "normal"-ed.
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, lfdirstate should
be updated with dirstate simultaneously. Hooking "markcommitted" of
ctx in "localrepository.commitctx" may achieve this.
This problem occurs, only when (1) the parent of the working directory
is rebased and (2) it removes largefiles, because:
- if the parent of the working directory isn't rebased, returning to
the initial revision (= update) after rebase hides this problem
- files added on "other" branch (= rebase target) are treated not as
"added" but as "modified" (= "normal" status and "unset"
timestamp) at merging
This patch tests also the status of added largefile, but it is only
for avoiding regression.
In addition to conditions above, "hg status" must not take existing
files to reproduce this problem, because existing files make
"match._files" not empty in "lfilesrepo.status" code path below:
def sfindirstate(f):
sf = lfutil.standin(f)
dirstate = self.dirstate
return sf in dirstate or sf in dirstate.dirs()
match._files = [f for f in match._files
if sfindirstate(f)]
Not empty "match._files" prevents "status" on lfdirstate from
returning the result containing problematic "R" files.
This is reason why "large1" (removed) and "largeX" (added) are checked
separately in this patch.
Problematic code path in "lfilesrepo.commit" is used also by "hg
transplant", but this problem doesn't occur at "hg transplant",
because invocation of "updatelfiles" after transplant-ing in
"overridetransplant" causes cleaning lfdirstate up.
This patch tests also "hg transplant" as same as "hg rebase", but it
is only for avoiding regression.
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A largeX
|
|
|
|
C largeX
|
|
|
|
$ hg strip -q 5
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ hg transplant -q --merge 1 --merge 4
|
2014-10-20 17:08:08 +04:00
|
|
|
#if windows
|
|
|
|
$ hg status -A large1
|
|
|
|
large1: * (glob)
|
|
|
|
#else
|
largefiles: synchronize lfdirstate with dirstate after automated committing
Before this patch, after successful "hg rebase" of the revision
removing largefiles, "hg status" may still show ""R" for such
largefiles unexpectedly.
"lfilesrepo.commit" executes the special code path for automated
committing while rebase/transplant, and lfdirstate entries for removed
files aren't updated in this code path, even after successful
committing.
Then, "R" entries still existing in lfdirstate cause unexpected "hg
status" output.
This patch synchronizes lfdirstate with dirstate after automated
committing.
This patch passes False as "normallookup" to "synclfdirstate", because
modified files in "files()" of the recent (= just committed) context
should be "normal"-ed.
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, lfdirstate should
be updated with dirstate simultaneously. Hooking "markcommitted" of
ctx in "localrepository.commitctx" may achieve this.
This problem occurs, only when (1) the parent of the working directory
is rebased and (2) it removes largefiles, because:
- if the parent of the working directory isn't rebased, returning to
the initial revision (= update) after rebase hides this problem
- files added on "other" branch (= rebase target) are treated not as
"added" but as "modified" (= "normal" status and "unset"
timestamp) at merging
This patch tests also the status of added largefile, but it is only
for avoiding regression.
In addition to conditions above, "hg status" must not take existing
files to reproduce this problem, because existing files make
"match._files" not empty in "lfilesrepo.status" code path below:
def sfindirstate(f):
sf = lfutil.standin(f)
dirstate = self.dirstate
return sf in dirstate or sf in dirstate.dirs()
match._files = [f for f in match._files
if sfindirstate(f)]
Not empty "match._files" prevents "status" on lfdirstate from
returning the result containing problematic "R" files.
This is reason why "large1" (removed) and "largeX" (added) are checked
separately in this patch.
Problematic code path in "lfilesrepo.commit" is used also by "hg
transplant", but this problem doesn't occur at "hg transplant",
because invocation of "updatelfiles" after transplant-ing in
"overridetransplant" causes cleaning lfdirstate up.
This patch tests also "hg transplant" as same as "hg rebase", but it
is only for avoiding regression.
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A large1
|
|
|
|
large1: No such file or directory
|
2014-10-20 17:08:08 +04:00
|
|
|
#endif
|
largefiles: synchronize lfdirstate with dirstate after automated committing
Before this patch, after successful "hg rebase" of the revision
removing largefiles, "hg status" may still show ""R" for such
largefiles unexpectedly.
"lfilesrepo.commit" executes the special code path for automated
committing while rebase/transplant, and lfdirstate entries for removed
files aren't updated in this code path, even after successful
committing.
Then, "R" entries still existing in lfdirstate cause unexpected "hg
status" output.
This patch synchronizes lfdirstate with dirstate after automated
committing.
This patch passes False as "normallookup" to "synclfdirstate", because
modified files in "files()" of the recent (= just committed) context
should be "normal"-ed.
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, lfdirstate should
be updated with dirstate simultaneously. Hooking "markcommitted" of
ctx in "localrepository.commitctx" may achieve this.
This problem occurs, only when (1) the parent of the working directory
is rebased and (2) it removes largefiles, because:
- if the parent of the working directory isn't rebased, returning to
the initial revision (= update) after rebase hides this problem
- files added on "other" branch (= rebase target) are treated not as
"added" but as "modified" (= "normal" status and "unset"
timestamp) at merging
This patch tests also the status of added largefile, but it is only
for avoiding regression.
In addition to conditions above, "hg status" must not take existing
files to reproduce this problem, because existing files make
"match._files" not empty in "lfilesrepo.status" code path below:
def sfindirstate(f):
sf = lfutil.standin(f)
dirstate = self.dirstate
return sf in dirstate or sf in dirstate.dirs()
match._files = [f for f in match._files
if sfindirstate(f)]
Not empty "match._files" prevents "status" on lfdirstate from
returning the result containing problematic "R" files.
This is reason why "large1" (removed) and "largeX" (added) are checked
separately in this patch.
Problematic code path in "lfilesrepo.commit" is used also by "hg
transplant", but this problem doesn't occur at "hg transplant",
because invocation of "updatelfiles" after transplant-ing in
"overridetransplant" causes cleaning lfdirstate up.
This patch tests also "hg transplant" as same as "hg rebase", but it
is only for avoiding regression.
2014-08-11 17:29:43 +04:00
|
|
|
$ hg status -A largeX
|
|
|
|
C largeX
|
|
|
|
$ hg strip -q 5
|
|
|
|
|
2014-08-15 15:28:51 +04:00
|
|
|
Test that linear merge can detect modification (and conflict) correctly
|
|
|
|
|
|
|
|
(linear merge without conflict)
|
|
|
|
|
|
|
|
$ echo 'large2 for linear merge (no conflict)' > large2
|
|
|
|
$ hg update 3 --config debug.dirstate.delaywrite=2
|
|
|
|
getting changed largefiles
|
|
|
|
1 largefiles updated, 0 removed
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg status -A large2
|
|
|
|
M large2
|
|
|
|
$ cat large2
|
|
|
|
large2 for linear merge (no conflict)
|
|
|
|
$ cat .hglf/large2
|
|
|
|
9c4bf8f1b33536d6e5f89447e10620cfe52ea710
|
|
|
|
|
|
|
|
(linear merge with conflict, choosing "other")
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ echo 'large1 for linear merge (conflict)' > large1
|
|
|
|
$ hg update 3 --config ui.interactive=True <<EOF
|
|
|
|
> o
|
|
|
|
> EOF
|
|
|
|
largefile large1 has a merge conflict
|
|
|
|
ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
|
2014-10-01 03:04:18 +04:00
|
|
|
take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
|
|
|
|
getting changed largefiles
|
2014-08-15 15:28:51 +04:00
|
|
|
1 largefiles updated, 0 removed
|
|
|
|
1 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg status -A large1
|
|
|
|
C large1
|
|
|
|
$ cat large1
|
|
|
|
large1 in #3
|
|
|
|
$ cat .hglf/large1
|
|
|
|
e5bb990443d6a92aaf7223813720f7566c9dd05b
|
|
|
|
|
|
|
|
(linear merge with conflict, choosing "local")
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ echo 'large1 for linear merge (conflict)' > large1
|
|
|
|
$ hg update 3 --config debug.dirstate.delaywrite=2
|
|
|
|
largefile large1 has a merge conflict
|
|
|
|
ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
|
|
|
|
take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
|
|
|
|
1 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg status -A large1
|
|
|
|
M large1
|
|
|
|
$ cat large1
|
|
|
|
large1 for linear merge (conflict)
|
|
|
|
$ cat .hglf/large1
|
|
|
|
ba94c2efe5b7c5e0af8d189295ce00553b0612b7
|
|
|
|
|
2014-08-15 15:28:51 +04:00
|
|
|
Test a linear merge to a revision containing same-name normal file
|
|
|
|
|
|
|
|
$ hg update -q -C 3
|
|
|
|
$ hg remove large2
|
|
|
|
$ echo 'large2 as normal file' > large2
|
|
|
|
$ hg add large2
|
|
|
|
$ echo 'large3 as normal file' > large3
|
|
|
|
$ hg add large3
|
|
|
|
$ hg commit -m '#5'
|
|
|
|
$ hg manifest
|
|
|
|
.hglf/large1
|
|
|
|
large2
|
|
|
|
large3
|
|
|
|
normal1
|
|
|
|
|
|
|
|
(modified largefile is already switched to normal)
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ echo 'modified large2 for linear merge' > large2
|
|
|
|
$ hg update -q 5
|
|
|
|
local changed .hglf/large2 which remote deleted
|
|
|
|
use (c)hanged version or (d)elete? c
|
|
|
|
remote turned local largefile large2 into a normal file
|
|
|
|
keep (l)argefile or use (n)ormal file? l
|
|
|
|
$ hg debugdirstate --nodates | grep large2
|
|
|
|
a 0 -1 .hglf/large2
|
|
|
|
r 0 0 large2
|
2014-08-15 15:28:51 +04:00
|
|
|
$ hg status -A large2
|
|
|
|
A large2
|
2014-08-15 15:28:51 +04:00
|
|
|
$ cat large2
|
|
|
|
modified large2 for linear merge
|
|
|
|
|
|
|
|
(added largefile is already committed as normal)
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ echo 'large3 as large file for linear merge' > large3
|
|
|
|
$ hg add --large large3
|
|
|
|
$ hg update -q 5
|
|
|
|
remote turned local largefile large3 into a normal file
|
|
|
|
keep (l)argefile or use (n)ormal file? l
|
|
|
|
$ hg debugdirstate --nodates | grep large3
|
|
|
|
a 0 -1 .hglf/large3
|
|
|
|
r 0 0 large3
|
2014-08-15 15:28:51 +04:00
|
|
|
$ hg status -A large3
|
|
|
|
A large3
|
2014-08-15 15:28:51 +04:00
|
|
|
$ cat large3
|
|
|
|
large3 as large file for linear merge
|
2014-08-24 18:47:26 +04:00
|
|
|
$ rm -f large3 .hglf/large3
|
|
|
|
|
|
|
|
Test that the internal linear merging works correctly
|
|
|
|
(both heads are stripped to keep pairing of revision number and commit log)
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ hg strip 3 4
|
|
|
|
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-backup.hg (glob)
|
|
|
|
$ mv .hg/strip-backup/9530e27857f7-backup.hg $TESTTMP
|
|
|
|
|
|
|
|
(internal linear merging at "hg pull --update")
|
|
|
|
|
|
|
|
$ echo 'large1 for linear merge (conflict)' > large1
|
|
|
|
$ echo 'large2 for linear merge (conflict with normal file)' > large2
|
|
|
|
$ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
|
|
|
|
pulling from $TESTTMP/9530e27857f7-backup.hg (glob)
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 3 changesets with 5 changes to 5 files
|
|
|
|
local changed .hglf/large2 which remote deleted
|
|
|
|
use (c)hanged version or (d)elete? c
|
|
|
|
remote turned local largefile large2 into a normal file
|
|
|
|
keep (l)argefile or use (n)ormal file? l
|
|
|
|
largefile large1 has a merge conflict
|
|
|
|
ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
|
|
|
|
take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
|
|
|
|
2 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg status -A large1
|
|
|
|
M large1
|
|
|
|
$ cat large1
|
|
|
|
large1 for linear merge (conflict)
|
|
|
|
$ cat .hglf/large1
|
|
|
|
ba94c2efe5b7c5e0af8d189295ce00553b0612b7
|
|
|
|
$ hg status -A large2
|
|
|
|
A large2
|
|
|
|
$ cat large2
|
|
|
|
large2 for linear merge (conflict with normal file)
|
|
|
|
$ cat .hglf/large2
|
|
|
|
d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
|
|
|
|
|
|
|
|
(internal linear merging at "hg unbundle --update")
|
|
|
|
|
|
|
|
$ hg update -q -C 2
|
|
|
|
$ hg rollback -q
|
|
|
|
|
|
|
|
$ echo 'large1 for linear merge (conflict)' > large1
|
|
|
|
$ echo 'large2 for linear merge (conflict with normal file)' > large2
|
|
|
|
$ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 3 changesets with 5 changes to 5 files
|
|
|
|
local changed .hglf/large2 which remote deleted
|
|
|
|
use (c)hanged version or (d)elete? c
|
|
|
|
remote turned local largefile large2 into a normal file
|
|
|
|
keep (l)argefile or use (n)ormal file? l
|
|
|
|
largefile large1 has a merge conflict
|
|
|
|
ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
|
|
|
|
take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
|
|
|
|
2 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg status -A large1
|
|
|
|
M large1
|
|
|
|
$ cat large1
|
|
|
|
large1 for linear merge (conflict)
|
|
|
|
$ cat .hglf/large1
|
|
|
|
ba94c2efe5b7c5e0af8d189295ce00553b0612b7
|
|
|
|
$ hg status -A large2
|
|
|
|
A large2
|
|
|
|
$ cat large2
|
|
|
|
large2 for linear merge (conflict with normal file)
|
|
|
|
$ cat .hglf/large2
|
|
|
|
d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
|
|
|
|
|
|
|
|
(internal linear merging in subrepo at "hg update")
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ hg init subparent
|
|
|
|
$ cd subparent
|
|
|
|
|
|
|
|
$ hg clone -q -u 2 ../repo sub
|
|
|
|
$ cat > .hgsub <<EOF
|
|
|
|
> sub = sub
|
|
|
|
> EOF
|
|
|
|
$ hg add .hgsub
|
|
|
|
$ hg commit -m '#0@parent'
|
|
|
|
$ cat .hgsubstate
|
|
|
|
f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
|
|
|
|
$ hg -R sub update -q
|
|
|
|
$ hg commit -m '#1@parent'
|
|
|
|
$ cat .hgsubstate
|
|
|
|
d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
|
|
|
|
$ hg update -q 0
|
|
|
|
|
|
|
|
$ echo 'large1 for linear merge (conflict)' > sub/large1
|
|
|
|
$ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
|
|
|
|
$ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
|
|
|
|
> m
|
|
|
|
> r
|
|
|
|
> c
|
|
|
|
> l
|
|
|
|
> l
|
|
|
|
> EOF
|
|
|
|
subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
|
2014-10-01 03:04:18 +04:00
|
|
|
(M)erge, keep (l)ocal or keep (r)emote? m
|
|
|
|
subrepository sources for sub differ (in checked out version)
|
2014-10-01 03:08:17 +04:00
|
|
|
use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
|
2014-10-01 03:04:18 +04:00
|
|
|
local changed .hglf/large2 which remote deleted
|
|
|
|
use (c)hanged version or (d)elete? c
|
|
|
|
remote turned local largefile large2 into a normal file
|
|
|
|
keep (l)argefile or use (n)ormal file? l
|
|
|
|
largefile large1 has a merge conflict
|
2014-08-24 18:47:26 +04:00
|
|
|
ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
|
2014-10-01 03:04:18 +04:00
|
|
|
take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
|
|
|
|
2 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
2014-08-24 18:47:26 +04:00
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg -R sub status -A sub/large1
|
|
|
|
M sub/large1
|
|
|
|
$ cat sub/large1
|
|
|
|
large1 for linear merge (conflict)
|
|
|
|
$ cat sub/.hglf/large1
|
|
|
|
ba94c2efe5b7c5e0af8d189295ce00553b0612b7
|
|
|
|
$ hg -R sub status -A sub/large2
|
|
|
|
A sub/large2
|
|
|
|
$ cat sub/large2
|
|
|
|
large2 for linear merge (conflict with normal file)
|
|
|
|
$ cat sub/.hglf/large2
|
|
|
|
d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
|
2014-08-15 15:28:51 +04:00
|
|
|
|
largefiles: use "normallookup", if "mtime" of standin is unset
Before this patch, largefiles gotten from "other" revision (without
conflict) at "hg merge" become "clean" unexpectedly in steps below:
1. "merge.update()" is invoked
1-1 standinfile SF is updated in the working directory
1-2 "dirstate" entry for SF is "normallookup"-ed
2. "lfcommands.updatelfiles()" is invoked (by "overrides.hgmerge()")
2-1 largefile LF (for SF) is updated in the working directory
2-2 "dirstate" returns "n" for SF (by 1-2)
2-3 "lfdirstate" entry for LF is "normal"-ed
2-4 "lfdirstate" is written into ".hg/largefiles/dirstate", and
timestamp of LF is stored into "lfdirstate" file
(ASSUMPTION: timestamp of LF differs from one of "lfdirstate" file)
Then, "hs status" treats LF as "clean", even though LF is updated by
"other" revision (by 2-1), because "lfilesrepo.status()" always treats
"normal"-ed files (by 2-3 and 2-4) as "clean".
When timestamp is not set (= negative value) for standinfile in
"dirstate", largefile should be "normallookup"-ed regardless of
rebasing or not, because "n" state in "dirstate" doesn't ensure
"clean"-ness of a standinfile at that time.
This patch uses "normallookup" instead of "normal", if "mtime" of
standin is unset
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, "lfdirstate" should
be updated with "dirstate" simultaneously while "merge.update"
execution: maybe by hooking "recordupdates"
It is also why this patch (temporarily) uses internal field "_map" of
"dirstate" directly.
This patch uses "[debug] dirstate.delaywrite" feature in the test, to
ensure that timestamp of the largefile gotten from "other" revision is
stored into ".hg/largefiles/dirstate". (for ASSUMPTION at 2-4)
This patch newly adds "test-largefiles-update.t", to avoid increasing
cost to run other tests for largefiles by subsequent patches
(especially, "[debug] dirstate.delaywrite" causes so).
2014-07-22 18:59:34 +04:00
|
|
|
$ cd ..
|
largefiles: update largefiles even if rebase is aborted by conflict
Before this patch, largefiles in the working directory aren't updated
correctly, if rebase is aborted by conflict. This prevents users from
viewing appropriate largefiles while resolving conflicts.
While rebase, largefiles in the working directory are updated only at
successful committing in the special code path of
"lfilesrepo.commit()".
To update largefiles even if rebase is aborted by conflict, this patch
centralizes the logic of updating largefiles in the working directory
into the "mergeupdate" wrapping "merge.update".
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, largefiles in the
working directory should be updated with other (normal) files
simultaneously while "merge.update" execution: maybe by hooking
"applyupdates".
"Action list based updating" introduced by hooking "applyupdates" will
also improve performance of updating, because it automatically
decreases target files to be checked.
Just after this patch, there are some improper things in "Case 0" code
path of "lfilesrepo.commit()":
- "updatelfiles" invocation is redundant for rebase
- detailed comment doesn't meet to rebase behavior
These will be resolved after the subsequent patch for transplant,
because this code path is shared with transplant.
Even though replacing "merge.update" in rebase extension by "hg.merge"
can also avoid this problem, this patch chooses centralizing the logic
into "mergeupdate", because:
- "merge.update" invocation in rebase extension can't be directly
replaced by "hg.merge", because:
- rebase requires some extra arguments, which "hg.merge" doesn't
take (e.g. "ancestor")
- rebase doesn't require statistics information forcibly displayed
in "hg.merge"
- introducing "mergeupdate" can resolve also problem of some other
code paths directly using "merge.update"
largefiles in the working directory aren't updated regardless of
the result of commands below, before this patch:
- backout (for revisions other than the parent revision of the
working directory without "--merge")
- graft
- histedit (for revisions other than the parent of the working
directory
When "partial" is specified, "merge.update" doesn't update dirstate
entries for standins, even though standins themselves are updated.
In this case, "normallookup" should be used to mark largefiles as
"possibly dirty" forcibly, because applying "normal" on lfdirstate
treats them as "clean" unexpectedly.
This is reason why "normallookup=partial" is specified for
"lfcommands.updatelfiles".
This patch doesn't test "hg rebase --continue", because it doesn't
work correctly if largefiles in the working directory are modified
manually while resolving conflicts. This will be fixed in the next
step of refactoring for largefiles.
All changes of tests/*.t files other than test-largefiles-update.t in
this patch come from invoking "updatelfiles" not after but before
statistics output of "hg.update", "hg.clean" and "hg.merge".
2014-08-24 18:47:26 +04:00
|
|
|
$ cd repo
|
|
|
|
|
|
|
|
Test that rebase updates largefiles in the working directory even if
|
|
|
|
it is aborted by conflict.
|
|
|
|
|
|
|
|
$ hg update -q -C 3
|
|
|
|
$ cat .hglf/large1
|
|
|
|
e5bb990443d6a92aaf7223813720f7566c9dd05b
|
|
|
|
$ cat large1
|
|
|
|
large1 in #3
|
|
|
|
$ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
|
|
|
|
> o
|
|
|
|
> EOF
|
|
|
|
largefile large1 has a merge conflict
|
|
|
|
ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
|
|
|
|
keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
|
2014-10-01 03:04:18 +04:00
|
|
|
take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
|
|
|
|
merging normal1
|
largefiles: update largefiles even if rebase is aborted by conflict
Before this patch, largefiles in the working directory aren't updated
correctly, if rebase is aborted by conflict. This prevents users from
viewing appropriate largefiles while resolving conflicts.
While rebase, largefiles in the working directory are updated only at
successful committing in the special code path of
"lfilesrepo.commit()".
To update largefiles even if rebase is aborted by conflict, this patch
centralizes the logic of updating largefiles in the working directory
into the "mergeupdate" wrapping "merge.update".
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, largefiles in the
working directory should be updated with other (normal) files
simultaneously while "merge.update" execution: maybe by hooking
"applyupdates".
"Action list based updating" introduced by hooking "applyupdates" will
also improve performance of updating, because it automatically
decreases target files to be checked.
Just after this patch, there are some improper things in "Case 0" code
path of "lfilesrepo.commit()":
- "updatelfiles" invocation is redundant for rebase
- detailed comment doesn't meet to rebase behavior
These will be resolved after the subsequent patch for transplant,
because this code path is shared with transplant.
Even though replacing "merge.update" in rebase extension by "hg.merge"
can also avoid this problem, this patch chooses centralizing the logic
into "mergeupdate", because:
- "merge.update" invocation in rebase extension can't be directly
replaced by "hg.merge", because:
- rebase requires some extra arguments, which "hg.merge" doesn't
take (e.g. "ancestor")
- rebase doesn't require statistics information forcibly displayed
in "hg.merge"
- introducing "mergeupdate" can resolve also problem of some other
code paths directly using "merge.update"
largefiles in the working directory aren't updated regardless of
the result of commands below, before this patch:
- backout (for revisions other than the parent revision of the
working directory without "--merge")
- graft
- histedit (for revisions other than the parent of the working
directory
When "partial" is specified, "merge.update" doesn't update dirstate
entries for standins, even though standins themselves are updated.
In this case, "normallookup" should be used to mark largefiles as
"possibly dirty" forcibly, because applying "normal" on lfdirstate
treats them as "clean" unexpectedly.
This is reason why "normallookup=partial" is specified for
"lfcommands.updatelfiles".
This patch doesn't test "hg rebase --continue", because it doesn't
work correctly if largefiles in the working directory are modified
manually while resolving conflicts. This will be fixed in the next
step of refactoring for largefiles.
All changes of tests/*.t files other than test-largefiles-update.t in
this patch come from invoking "updatelfiles" not after but before
statistics output of "hg.update", "hg.clean" and "hg.merge".
2014-08-24 18:47:26 +04:00
|
|
|
warning: conflicts during merge.
|
|
|
|
merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
|
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
|
|
|
[1]
|
|
|
|
$ cat .hglf/large1
|
|
|
|
58e24f733a964da346e2407a2bee99d9001184f5
|
|
|
|
$ cat large1
|
|
|
|
large1 in #1
|
|
|
|
|
|
|
|
$ hg rebase -q --abort
|
|
|
|
rebase aborted
|
|
|
|
|
2014-08-24 18:47:26 +04:00
|
|
|
Test that transplant updates largefiles, of which standins are safely
|
|
|
|
changed, even if it is aborted by conflict of other.
|
|
|
|
|
|
|
|
$ hg update -q -C 5
|
|
|
|
$ cat .hglf/large1
|
|
|
|
e5bb990443d6a92aaf7223813720f7566c9dd05b
|
|
|
|
$ cat large1
|
|
|
|
large1 in #3
|
|
|
|
$ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
|
|
|
|
+fa44618ea25181aff4f48b70428294790cec9f61
|
|
|
|
$ hg transplant 4
|
|
|
|
applying 07d6153b5c04
|
|
|
|
patching file .hglf/large1
|
|
|
|
Hunk #1 FAILED at 0
|
|
|
|
1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
|
|
|
|
patch failed to apply
|
|
|
|
abort: fix up the merge and run hg transplant --continue
|
|
|
|
[255]
|
|
|
|
$ hg status -A large1
|
|
|
|
C large1
|
|
|
|
$ cat .hglf/large1
|
|
|
|
e5bb990443d6a92aaf7223813720f7566c9dd05b
|
|
|
|
$ cat large1
|
|
|
|
large1 in #3
|
|
|
|
$ hg status -A largeX
|
|
|
|
A largeX
|
|
|
|
$ cat .hglf/largeX
|
|
|
|
fa44618ea25181aff4f48b70428294790cec9f61
|
|
|
|
$ cat largeX
|
|
|
|
largeX
|
|
|
|
|
largefiles: update largefiles even if rebase is aborted by conflict
Before this patch, largefiles in the working directory aren't updated
correctly, if rebase is aborted by conflict. This prevents users from
viewing appropriate largefiles while resolving conflicts.
While rebase, largefiles in the working directory are updated only at
successful committing in the special code path of
"lfilesrepo.commit()".
To update largefiles even if rebase is aborted by conflict, this patch
centralizes the logic of updating largefiles in the working directory
into the "mergeupdate" wrapping "merge.update".
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, largefiles in the
working directory should be updated with other (normal) files
simultaneously while "merge.update" execution: maybe by hooking
"applyupdates".
"Action list based updating" introduced by hooking "applyupdates" will
also improve performance of updating, because it automatically
decreases target files to be checked.
Just after this patch, there are some improper things in "Case 0" code
path of "lfilesrepo.commit()":
- "updatelfiles" invocation is redundant for rebase
- detailed comment doesn't meet to rebase behavior
These will be resolved after the subsequent patch for transplant,
because this code path is shared with transplant.
Even though replacing "merge.update" in rebase extension by "hg.merge"
can also avoid this problem, this patch chooses centralizing the logic
into "mergeupdate", because:
- "merge.update" invocation in rebase extension can't be directly
replaced by "hg.merge", because:
- rebase requires some extra arguments, which "hg.merge" doesn't
take (e.g. "ancestor")
- rebase doesn't require statistics information forcibly displayed
in "hg.merge"
- introducing "mergeupdate" can resolve also problem of some other
code paths directly using "merge.update"
largefiles in the working directory aren't updated regardless of
the result of commands below, before this patch:
- backout (for revisions other than the parent revision of the
working directory without "--merge")
- graft
- histedit (for revisions other than the parent of the working
directory
When "partial" is specified, "merge.update" doesn't update dirstate
entries for standins, even though standins themselves are updated.
In this case, "normallookup" should be used to mark largefiles as
"possibly dirty" forcibly, because applying "normal" on lfdirstate
treats them as "clean" unexpectedly.
This is reason why "normallookup=partial" is specified for
"lfcommands.updatelfiles".
This patch doesn't test "hg rebase --continue", because it doesn't
work correctly if largefiles in the working directory are modified
manually while resolving conflicts. This will be fixed in the next
step of refactoring for largefiles.
All changes of tests/*.t files other than test-largefiles-update.t in
this patch come from invoking "updatelfiles" not after but before
statistics output of "hg.update", "hg.clean" and "hg.merge".
2014-08-24 18:47:26 +04:00
|
|
|
$ cd ..
|