Mercurial > hg-stable
changeset 15383:155d0f8fb7e5 stable
largefiles: fix bad bug where transplanting a changeset with a largefile will result in an old largefile being comitted later on
author | Na'Tosha Bard <natosha@unity3d.com> |
---|---|
date | Fri, 28 Oct 2011 18:48:24 +0200 |
parents | b59e6b1e0c95 |
children | bf55991af17e |
files | hgext/largefiles/overrides.py hgext/largefiles/uisetup.py tests/test-largefiles.t |
diffstat | 3 files changed, 94 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Fri Oct 28 18:17:44 2011 +0200 +++ b/hgext/largefiles/overrides.py Fri Oct 28 18:48:24 2011 +0200 @@ -817,3 +817,8 @@ lfdirstate.add(file) lfdirstate.write() return result + +def override_transplant(orig, ui, repo, *revs, **opts): + result = orig(ui, repo, *revs, **opts) + lfcommands.updatelfiles(repo.ui, repo) + return result
--- a/hgext/largefiles/uisetup.py Fri Oct 28 18:17:44 2011 +0200 +++ b/hgext/largefiles/uisetup.py Fri Oct 28 18:48:24 2011 +0200 @@ -132,3 +132,6 @@ if name == 'rebase': extensions.wrapcommand(getattr(module, 'cmdtable'), 'rebase', overrides.override_rebase) + if name == 'transplant': + extensions.wrapcommand(getattr(module, 'cmdtable'), 'transplant', + overrides.override_transplant)
--- a/tests/test-largefiles.t Fri Oct 28 18:17:44 2011 +0200 +++ b/tests/test-largefiles.t Fri Oct 28 18:48:24 2011 +0200 @@ -3,6 +3,7 @@ > largefiles= > purge= > rebase= + > transplant= > [largefiles] > minsize=2 > patterns=glob:**.dat @@ -740,6 +741,91 @@ $ echo "largeasnormal" > sub2/large7 $ hg add sub2/large7 sub2/large7 already a largefile + +Test that transplanting a largefile change works correctly. + + $ cd .. + $ hg clone -r 8 d g + adding changesets + adding manifests + adding file changes + added 9 changesets with 26 changes to 10 files + updating to branch default + 5 files updated, 0 files merged, 0 files removed, 0 files unresolved + getting changed largefiles + 3 largefiles updated, 0 removed + $ cd g + $ hg transplant -s ../d 598410d3eb9a + searching for changes + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 2 changes to 2 files + getting changed largefiles + 1 largefiles updated, 0 removed + $ hg log + changeset: 9:598410d3eb9a + tag: tip + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: modify normal file largefile in repo d + + changeset: 8:a381d2c8c80e + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: modify normal file and largefile in repo b + + changeset: 7:daea875e9014 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add/edit more largefiles + + changeset: 6:4355d653f84f + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: edit files yet again + + changeset: 5:9d5af5072dbd + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: edit files again + + changeset: 4:74c02385b94c + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: move files + + changeset: 3:9e8fbc4bce62 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: copy files + + changeset: 2:51a0ae4d5864 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: remove files + + changeset: 1:ce8896473775 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: edit files + + changeset: 0:30d30fe6a5be + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add files + + $ cat normal3 + normal3-modified + $ cat sub/normal4 + normal4-modified + $ cat sub/large4 + large4-modified + $ cat sub2/large6 + large6-modified + $ cat sub2/large7 + large7 $ cd .. vanilla clients not locked out from largefiles servers on vanilla repos