##// END OF EJS Templates
branching: merge with stable
Martin von Zweigbergk -
r47244:d67732a4 merge default
parent child Browse files
Show More
@@ -1853,7 +1853,7 b' def upgraderequirements(orig, repo):'
1853
1853
1854
1854
1855 @eh.wrapfunction(urlmod, b'open')
1855 @eh.wrapfunction(urlmod, b'open')
1856 def openlargefile(orig, ui, url_, data=None):
1856 def openlargefile(orig, ui, url_, data=None, **kwargs):
1857 if url_.startswith(_lfscheme):
1857 if url_.startswith(_lfscheme):
1858 if data:
1858 if data:
1859 msg = b"cannot use data on a 'largefile://' url"
1859 msg = b"cannot use data on a 'largefile://' url"
@@ -1861,4 +1861,4 b' def openlargefile(orig, ui, url_, data=N'
1861 lfid = url_[len(_lfscheme) :]
1861 lfid = url_[len(_lfscheme) :]
1862 return storefactory.getlfile(ui, lfid)
1862 return storefactory.getlfile(ui, lfid)
1863 else:
1863 else:
1864 return orig(ui, url_, data=data)
1864 return orig(ui, url_, data=data, **kwargs)
@@ -3145,7 +3145,7 b' def commitstatus(repo, node, branch, bhe'
3145 # avoid reporting something like "committed new head" when
3145 # avoid reporting something like "committed new head" when
3146 # recommitting old changesets, and issue a helpful warning
3146 # recommitting old changesets, and issue a helpful warning
3147 # for most instances
3147 # for most instances
3148 repo.ui.warn(_("warning: commit already existed in the repository!\n"))
3148 repo.ui.warn(_(b"warning: commit already existed in the repository!\n"))
3149 elif (
3149 elif (
3150 not opts.get(b'amend')
3150 not opts.get(b'amend')
3151 and bheads
3151 and bheads
@@ -1333,11 +1333,17 b' coreconfigitem('
1333 )
1333 )
1334 coreconfigitem(
1334 coreconfigitem(
1335 b'hooks',
1335 b'hooks',
1336 b'.*',
1336 b'[^:]*',
1337 default=dynamicdefault,
1337 default=dynamicdefault,
1338 generic=True,
1338 generic=True,
1339 )
1339 )
1340 coreconfigitem(
1340 coreconfigitem(
1341 b'hooks',
1342 b'.*:run-with-plain',
1343 default=True,
1344 generic=True,
1345 )
1346 coreconfigitem(
1341 b'hgweb-paths',
1347 b'hgweb-paths',
1342 b'.*',
1348 b'.*',
1343 default=list,
1349 default=list,
@@ -1027,6 +1027,13 b' Example ``.hg/hgrc``::'
1027 incoming.autobuild = /my/build/hook
1027 incoming.autobuild = /my/build/hook
1028 # force autobuild hook to run before other incoming hooks
1028 # force autobuild hook to run before other incoming hooks
1029 priority.incoming.autobuild = 1
1029 priority.incoming.autobuild = 1
1030 ### control HGPLAIN setting when running autobuild hook
1031 # HGPLAIN always set (default from Mercurial 5.7)
1032 incoming.autobuild:run-with-plain = yes
1033 # HGPLAIN never set
1034 incoming.autobuild:run-with-plain = no
1035 # HGPLAIN inherited from environment (default before Mercurila 5.7)
1036 incoming.autobuild:run-with-plain = auto
1030
1037
1031 Most hooks are run with environment variables set that give useful
1038 Most hooks are run with environment variables set that give useful
1032 additional information. For each hook below, the environment variables
1039 additional information. For each hook below, the environment variables
@@ -157,7 +157,15 b' def _exthook(ui, repo, htype, name, cmd,'
157 env[b'HG_PENDING'] = repo.root
157 env[b'HG_PENDING'] = repo.root
158 env[b'HG_HOOKTYPE'] = htype
158 env[b'HG_HOOKTYPE'] = htype
159 env[b'HG_HOOKNAME'] = name
159 env[b'HG_HOOKNAME'] = name
160 env[b'HGPLAIN'] = b'1'
160
161 if ui.config(b'hooks', b'%s:run-with-plain' % name) == b'auto':
162 plain = ui.plain()
163 else:
164 plain = ui.configbool(b'hooks', b'%s:run-with-plain' % name)
165 if plain:
166 env[b'HGPLAIN'] = b'1'
167 else:
168 env[b'HGPLAIN'] = b''
161
169
162 for k, v in pycompat.iteritems(args):
170 for k, v in pycompat.iteritems(args):
163 # transaction changes can accumulate MBs of data, so skip it
171 # transaction changes can accumulate MBs of data, so skip it
@@ -224,7 +232,11 b' def _hookitems(ui, _untrusted=False):'
224 """return all hooks items ready to be sorted"""
232 """return all hooks items ready to be sorted"""
225 hooks = {}
233 hooks = {}
226 for name, cmd in ui.configitems(b'hooks', untrusted=_untrusted):
234 for name, cmd in ui.configitems(b'hooks', untrusted=_untrusted):
227 if name.startswith(b'priority.') or name.startswith(b'tonative.'):
235 if (
236 name.startswith(b'priority.')
237 or name.startswith(b'tonative.')
238 or b':' in name
239 ):
228 continue
240 continue
229
241
230 priority = ui.configint(b'hooks', b'priority.%s' % name, 0)
242 priority = ui.configint(b'hooks', b'priority.%s' % name, 0)
@@ -60,8 +60,6 b' urlreq = util.urlreq'
60 # The config knobs that will be altered (if unset) by ui.tweakdefaults.
60 # The config knobs that will be altered (if unset) by ui.tweakdefaults.
61 tweakrc = b"""
61 tweakrc = b"""
62 [ui]
62 [ui]
63 # Gives detailed exit codes for input/user errors, config errors, etc.
64 detailed-exit-code = True
65 # The rollback command is dangerous. As a rule, don't use it.
63 # The rollback command is dangerous. As a rule, don't use it.
66 rollback = False
64 rollback = False
67 # Make `hg status` report copy information
65 # Make `hg status` report copy information
@@ -546,7 +546,11 b' def _gui():'
546 # pure build; use a safe default
546 # pure build; use a safe default
547 return True
547 return True
548 else:
548 else:
549 return pycompat.iswindows or encoding.environ.get(b"DISPLAY")
549 return (
550 pycompat.iswindows
551 or encoding.environ.get(b"DISPLAY")
552 or encoding.environ.get(b"WAYLAND_DISPLAY")
553 )
550
554
551
555
552 def gui():
556 def gui():
@@ -19,9 +19,6 b''
19
19
20 * `hg purge` is now a core command using `--confirm` by default.
20 * `hg purge` is now a core command using `--confirm` by default.
21
21
22 * `hg strip`, from the strip extension, is now a core command, `hg
23 debugstrip`. The extension remains for compatibility.
24
25 * `hg diff` and `hg extdiff` now support `--from <rev>` and `--to <rev>`
22 * `hg diff` and `hg extdiff` now support `--from <rev>` and `--to <rev>`
26 arguments as clearer alternatives to `-r <revs>`. `-r <revs>` has been
23 arguments as clearer alternatives to `-r <revs>`. `-r <revs>` has been
27 deprecated.
24 deprecated.
@@ -776,58 +776,66 b' where'
776 #[cfg(not(feature = "dirstate-tree"))]
776 #[cfg(not(feature = "dirstate-tree"))]
777 #[timed]
777 #[timed]
778 pub fn extend_from_dmap(&self, results: &mut Vec<DispatchedPath<'a>>) {
778 pub fn extend_from_dmap(&self, results: &mut Vec<DispatchedPath<'a>>) {
779 results.par_extend(self.dmap.par_iter().map(
779 results.par_extend(
780 move |(filename, entry)| {
780 self.dmap
781 let filename: &HgPath = filename;
781 .par_iter()
782 let filename_as_path = match hg_path_to_path_buf(filename) {
782 .filter(|(path, _)| self.matcher.matches(path))
783 Ok(f) => f,
783 .map(move |(filename, entry)| {
784 Err(_) => {
784 let filename: &HgPath = filename;
785 return (
785 let filename_as_path = match hg_path_to_path_buf(filename)
786 {
787 Ok(f) => f,
788 Err(_) => {
789 return (
790 Cow::Borrowed(filename),
791 INVALID_PATH_DISPATCH,
792 )
793 }
794 };
795 let meta = self
796 .root_dir
797 .join(filename_as_path)
798 .symlink_metadata();
799 match meta {
800 Ok(m)
801 if !(m.file_type().is_file()
802 || m.file_type().is_symlink()) =>
803 {
804 (
805 Cow::Borrowed(filename),
806 dispatch_missing(entry.state),
807 )
808 }
809 Ok(m) => (
786 Cow::Borrowed(filename),
810 Cow::Borrowed(filename),
787 INVALID_PATH_DISPATCH,
811 dispatch_found(
788 )
812 filename,
789 }
813 *entry,
790 };
814 HgMetadata::from_metadata(m),
791 let meta =
815 &self.dmap.copy_map,
792 self.root_dir.join(filename_as_path).symlink_metadata();
816 self.options,
793 match meta {
817 ),
794 Ok(m)
818 ),
795 if !(m.file_type().is_file()
819 Err(e)
796 || m.file_type().is_symlink()) =>
820 if e.kind() == ErrorKind::NotFound
797 {
821 || e.raw_os_error() == Some(20) =>
798 (
822 {
799 Cow::Borrowed(filename),
823 // Rust does not yet have an `ErrorKind` for
800 dispatch_missing(entry.state),
824 // `NotADirectory` (errno 20)
801 )
825 // It happens if the dirstate contains `foo/bar`
826 // and foo is not a
827 // directory
828 (
829 Cow::Borrowed(filename),
830 dispatch_missing(entry.state),
831 )
832 }
833 Err(e) => {
834 (Cow::Borrowed(filename), dispatch_os_error(&e))
835 }
802 }
836 }
803 Ok(m) => (
837 }),
804 Cow::Borrowed(filename),
838 );
805 dispatch_found(
806 filename,
807 *entry,
808 HgMetadata::from_metadata(m),
809 &self.dmap.copy_map,
810 self.options,
811 ),
812 ),
813 Err(e)
814 if e.kind() == ErrorKind::NotFound
815 || e.raw_os_error() == Some(20) =>
816 {
817 // Rust does not yet have an `ErrorKind` for
818 // `NotADirectory` (errno 20)
819 // It happens if the dirstate contains `foo/bar`
820 // and foo is not a
821 // directory
822 (
823 Cow::Borrowed(filename),
824 dispatch_missing(entry.state),
825 )
826 }
827 Err(e) => (Cow::Borrowed(filename), dispatch_os_error(&e)),
828 }
829 },
830 ));
831 }
839 }
832
840
833 /// Checks all files that are in the dirstate but were not found during the
841 /// Checks all files that are in the dirstate but were not found during the
@@ -1138,6 +1138,21 b' test import rev as raw-rev'
1138 $ cd test1
1138 $ cd test1
1139 $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1
1139 $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1
1140
1140
1141 repeat test above, with largefiles enabled
1142
1143 $ cd ..
1144 $ rm -r test1
1145 $ hg clone -r0 test test1
1146 adding changesets
1147 adding manifests
1148 adding file changes
1149 added 1 changesets with 2 changes to 2 files
1150 new changesets 0cd96de13884
1151 updating to branch default
1152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1153 $ cd test1
1154 $ hg import --config extensions.largefiles= -q --bypass --exact http://localhost:$HGPORT/rev/1
1155
1141 raw revision with diff block numbers
1156 raw revision with diff block numbers
1142
1157
1143 $ killdaemons.py
1158 $ killdaemons.py
@@ -1390,3 +1390,42 b' Non-blocking hook'
1390 date: Thu Jan 01 00:00:00 1970 +0000
1390 date: Thu Jan 01 00:00:00 1970 +0000
1391 summary: a
1391 summary: a
1392
1392
1393
1394 unsetup the test
1395 ----------------
1396
1397 # touch the file to unconfuse chg with a diffrent mtime
1398 $ sleep 1
1399 $ touch $TESTTMP/untrusted.py
1400 $ cat << EOF >> $HGRCPATH
1401 > [extensions]
1402 > untrusted=!
1403 > EOF
1404
1405 HGPLAIN setting in hooks
1406 ========================
1407
1408 $ cat << EOF >> .hg/hgrc
1409 > [hooks]
1410 > pre-version.testing-default=echo '### default ###' plain: \${HGPLAIN:-'<unset>'}
1411 > pre-version.testing-yes=echo '### yes #######' plain: \${HGPLAIN:-'<unset>'}
1412 > pre-version.testing-yes:run-with-plain=yes
1413 > pre-version.testing-no=echo '### no ########' plain: \${HGPLAIN:-'<unset>'}
1414 > pre-version.testing-no:run-with-plain=no
1415 > pre-version.testing-auto=echo '### auto ######' plain: \${HGPLAIN:-'<unset>'}
1416 > pre-version.testing-auto:run-with-plain=auto
1417 > EOF
1418
1419 $ (unset HGPLAIN; hg version --quiet)
1420 ### default ### plain: 1
1421 ### yes ####### plain: 1
1422 ### no ######## plain: <unset>
1423 ### auto ###### plain: <unset>
1424 Mercurial Distributed SCM (*) (glob)
1425
1426 $ HGPLAIN=1 hg version --quiet
1427 ### default ### plain: 1
1428 ### yes ####### plain: 1
1429 ### no ######## plain: <unset>
1430 ### auto ###### plain: 1
1431 Mercurial Distributed SCM (*) (glob)
@@ -680,3 +680,14 b" Make sure .hg doesn't show up even as a "
680 $ cd symlink-repo0
680 $ cd symlink-repo0
681 $ ln -s ../repo0/.hg
681 $ ln -s ../repo0/.hg
682 $ hg status
682 $ hg status
683
684 Check using include flag with pattern when status does not need to traverse
685 the working directory (issue6483)
686
687 $ cd ..
688 $ hg init issue6483
689 $ cd issue6483
690 $ touch a.py b.rs
691 $ hg add a.py b.rs
692 $ hg st -aI "*.py"
693 A a.py
General Comments 0
You need to be logged in to leave comments. Login now