Show More
@@ -11,11 +11,10 b'' | |||||
11 | import os |
|
11 | import os | |
12 | import copy |
|
12 | import copy | |
13 |
|
13 | |||
14 |
from mercurial import hg |
|
14 | from mercurial import hg, util, cmdutil, scmutil, match as match_, \ | |
15 | archival, pathutil, revset |
|
15 | archival, pathutil, revset | |
16 | from mercurial.i18n import _ |
|
16 | from mercurial.i18n import _ | |
17 | from mercurial.node import hex |
|
17 | from mercurial.node import hex | |
18 | from hgext import rebase |
|
|||
19 |
|
18 | |||
20 | import lfutil |
|
19 | import lfutil | |
21 | import lfcommands |
|
20 | import lfcommands | |
@@ -710,37 +709,14 b' def overriderevert(orig, ui, repo, *pats' | |||||
710 | finally: |
|
709 | finally: | |
711 | wlock.release() |
|
710 | wlock.release() | |
712 |
|
711 | |||
713 | # When we rebase a repository with remotely changed largefiles, we need to |
|
712 | # after pulling changesets, we need to take some extra care to get | |
714 | # take some extra care so that the largefiles are correctly updated in the |
|
713 | # largefiles updated remotely | |
715 | # working copy |
|
|||
716 | def overridepull(orig, ui, repo, source=None, **opts): |
|
714 | def overridepull(orig, ui, repo, source=None, **opts): | |
717 | revsprepull = len(repo) |
|
715 | revsprepull = len(repo) | |
718 | if not source: |
|
716 | if not source: | |
719 | source = 'default' |
|
717 | source = 'default' | |
720 | repo.lfpullsource = source |
|
718 | repo.lfpullsource = source | |
721 | if opts.get('rebase', False): |
|
719 | result = orig(ui, repo, source, **opts) | |
722 | repo._isrebasing = True |
|
|||
723 | try: |
|
|||
724 | if opts.get('update'): |
|
|||
725 | del opts['update'] |
|
|||
726 | ui.debug('--update and --rebase are not compatible, ignoring ' |
|
|||
727 | 'the update flag\n') |
|
|||
728 | del opts['rebase'] |
|
|||
729 | origpostincoming = commands.postincoming |
|
|||
730 | def _dummy(*args, **kwargs): |
|
|||
731 | pass |
|
|||
732 | commands.postincoming = _dummy |
|
|||
733 | try: |
|
|||
734 | result = commands.pull(ui, repo, source, **opts) |
|
|||
735 | finally: |
|
|||
736 | commands.postincoming = origpostincoming |
|
|||
737 | revspostpull = len(repo) |
|
|||
738 | if revspostpull > revsprepull: |
|
|||
739 | result = result or rebase.rebase(ui, repo) |
|
|||
740 | finally: |
|
|||
741 | repo._isrebasing = False |
|
|||
742 | else: |
|
|||
743 | result = orig(ui, repo, source, **opts) |
|
|||
744 | revspostpull = len(repo) |
|
720 | revspostpull = len(repo) | |
745 | lfrevs = opts.get('lfrev', []) |
|
721 | lfrevs = opts.get('lfrev', []) | |
746 | if opts.get('all_largefiles'): |
|
722 | if opts.get('all_largefiles'): |
@@ -832,4 +832,33 b' locally (issue4109)' | |||||
832 | $ cd .. |
|
832 | $ cd .. | |
833 |
|
833 | |||
834 |
|
834 | |||
|
835 | Test "pull --rebase" when rebase is enabled before largefiles (issue3861) | |||
|
836 | ========================================================================= | |||
835 |
|
837 | |||
|
838 | $ hg showconfig extensions | grep largefiles | |||
|
839 | extensions.largefiles=! | |||
|
840 | ||||
|
841 | $ mkdir issue3861 | |||
|
842 | $ cd issue3861 | |||
|
843 | $ hg init src | |||
|
844 | $ hg clone -q src dst | |||
|
845 | $ echo a > src/a | |||
|
846 | $ hg -R src commit -Aqm "#0" | |||
|
847 | Invoking status precommit hook | |||
|
848 | A a | |||
|
849 | ||||
|
850 | $ cat >> dst/.hg/hgrc <<EOF | |||
|
851 | > [extensions] | |||
|
852 | > largefiles= | |||
|
853 | > EOF | |||
|
854 | $ hg -R dst pull --rebase | |||
|
855 | pulling from $TESTTMP/issue3861/src (glob) | |||
|
856 | requesting all changes | |||
|
857 | adding changesets | |||
|
858 | adding manifests | |||
|
859 | adding file changes | |||
|
860 | added 1 changesets with 1 changes to 1 files | |||
|
861 | nothing to rebase - working directory parent is already an ancestor of destination bf5e395ced2c | |||
|
862 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
863 | ||||
|
864 | $ cd .. |
@@ -1172,12 +1172,11 b' rebased or not.' | |||||
1172 | adding manifests |
|
1172 | adding manifests | |
1173 | adding file changes |
|
1173 | adding file changes | |
1174 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
1174 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
|
1175 | 0 largefiles cached | |||
1175 | Invoking status precommit hook |
|
1176 | Invoking status precommit hook | |
1176 | M sub/normal4 |
|
1177 | M sub/normal4 | |
1177 | M sub2/large6 |
|
1178 | M sub2/large6 | |
1178 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
1179 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) | |
1179 | 0 largefiles cached |
|
|||
1180 | nothing to rebase - working directory parent is also destination |
|
|||
1181 | $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] |
|
1180 | $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] | |
1182 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
1181 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
1183 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1182 | 9:598410d3eb9a modify normal file largefile in repo d |
General Comments 0
You need to be logged in to leave comments.
Login now