Fossil SCM
Docs and visibility for versionable settings: Add versionable marker in the web UI. Output of the settings command notes if the value is overridden. Update help text for settings command noting versionable status and that glob settings can be newline separated.
Commit
b5d45262111e7549cc089d32faa29b05378c2d17
Parent
761a98a1ee390b9…
2 files changed
+60
-45
+11
-2
M
src/db.c
+60
-45
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1641,30 +1641,39 @@ | ||
| 1641 | 1641 | } |
| 1642 | 1642 | |
| 1643 | 1643 | /* |
| 1644 | 1644 | ** Print the value of a setting named zName |
| 1645 | 1645 | */ |
| 1646 | -static void print_setting(const char *zName){ | |
| 1646 | +static void print_setting(const struct stControlSettings *ctrlSetting, int localOpen){ | |
| 1647 | 1647 | Stmt q; |
| 1648 | 1648 | if( g.repositoryOpen ){ |
| 1649 | 1649 | db_prepare(&q, |
| 1650 | 1650 | "SELECT '(local)', value FROM config WHERE name=%Q" |
| 1651 | 1651 | " UNION ALL " |
| 1652 | 1652 | "SELECT '(global)', value FROM global_config WHERE name=%Q", |
| 1653 | - zName, zName | |
| 1653 | + ctrlSetting->name, ctrlSetting->name | |
| 1654 | 1654 | ); |
| 1655 | 1655 | }else{ |
| 1656 | 1656 | db_prepare(&q, |
| 1657 | 1657 | "SELECT '(global)', value FROM global_config WHERE name=%Q", |
| 1658 | - zName | |
| 1658 | + ctrlSetting->name | |
| 1659 | 1659 | ); |
| 1660 | 1660 | } |
| 1661 | 1661 | if( db_step(&q)==SQLITE_ROW ){ |
| 1662 | - fossil_print("%-20s %-8s %s\n", zName, db_column_text(&q, 0), | |
| 1662 | + fossil_print("%-20s %-8s %s\n", ctrlSetting->name, db_column_text(&q, 0), | |
| 1663 | 1663 | db_column_text(&q, 1)); |
| 1664 | 1664 | }else{ |
| 1665 | - fossil_print("%-20s\n", zName); | |
| 1665 | + fossil_print("%-20s\n", ctrlSetting->name); | |
| 1666 | + } | |
| 1667 | + if( ctrlSetting->versionable && localOpen ){ | |
| 1668 | + /* Check to see if this is overridden by a versionable settings file */ | |
| 1669 | + Blob versionedPathname; | |
| 1670 | + blob_zero(&versionedPathname); | |
| 1671 | + blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", g.zLocalRoot, ctrlSetting->name); | |
| 1672 | + if( file_size(blob_str(&versionedPathname))>=0 ){ | |
| 1673 | + fossil_print(" (overridden by contents of file .fossil-settings/%s)\n", ctrlSetting->name); | |
| 1674 | + } | |
| 1666 | 1675 | } |
| 1667 | 1676 | db_finalize(&q); |
| 1668 | 1677 | } |
| 1669 | 1678 | |
| 1670 | 1679 | |
| @@ -1680,43 +1689,44 @@ | ||
| 1680 | 1689 | #if INTERFACE |
| 1681 | 1690 | struct stControlSettings { |
| 1682 | 1691 | char const *name; /* Name of the setting */ |
| 1683 | 1692 | char const *var; /* Internal variable name used by db_set() */ |
| 1684 | 1693 | int width; /* Width of display. 0 for boolean values */ |
| 1694 | + int versionable; /* Is this setting versionable? */ | |
| 1685 | 1695 | char const *def; /* Default value */ |
| 1686 | 1696 | }; |
| 1687 | 1697 | #endif /* INTERFACE */ |
| 1688 | 1698 | struct stControlSettings const ctrlSettings[] = { |
| 1689 | - { "access-log", 0, 0, "off" }, | |
| 1690 | - { "auto-captcha", "autocaptcha", 0, "on" }, | |
| 1691 | - { "auto-shun", 0, 0, "on" }, | |
| 1692 | - { "autosync", 0, 0, "on" }, | |
| 1693 | - { "binary-glob", 0, 32, "" }, | |
| 1694 | - { "clearsign", 0, 0, "off" }, | |
| 1695 | - { "crnl-glob", 0, 16, "" }, | |
| 1696 | - { "default-perms", 0, 16, "u" }, | |
| 1697 | - { "diff-command", 0, 16, "" }, | |
| 1698 | - { "dont-push", 0, 0, "off" }, | |
| 1699 | - { "editor", 0, 16, "" }, | |
| 1700 | - { "gdiff-command", 0, 16, "gdiff" }, | |
| 1701 | - { "gmerge-command",0, 40, "" }, | |
| 1702 | - { "https-login", 0, 0, "off" }, | |
| 1703 | - { "ignore-glob", 0, 40, "" }, | |
| 1704 | - { "empty-dirs", 0, 40, "" }, | |
| 1705 | - { "http-port", 0, 16, "8080" }, | |
| 1706 | - { "localauth", 0, 0, "off" }, | |
| 1707 | - { "main-branch", 0, 40, "trunk" }, | |
| 1708 | - { "manifest", 0, 0, "off" }, | |
| 1709 | - { "max-upload", 0, 25, "250000" }, | |
| 1710 | - { "mtime-changes", 0, 0, "on" }, | |
| 1711 | - { "pgp-command", 0, 32, "gpg --clearsign -o " }, | |
| 1712 | - { "proxy", 0, 32, "off" }, | |
| 1713 | - { "repo-cksum", 0, 0, "on" }, | |
| 1714 | - { "self-register", 0, 0, "off" }, | |
| 1715 | - { "ssh-command", 0, 32, "" }, | |
| 1716 | - { "web-browser", 0, 32, "" }, | |
| 1717 | - { 0,0,0,0 } | |
| 1699 | + { "access-log", 0, 0, 0, "off" }, | |
| 1700 | + { "auto-captcha", "autocaptcha", 0, 0, "on" }, | |
| 1701 | + { "auto-shun", 0, 0, 0, "on" }, | |
| 1702 | + { "autosync", 0, 0, 0, "on" }, | |
| 1703 | + { "binary-glob", 0, 32, 1, "" }, | |
| 1704 | + { "clearsign", 0, 0, 0, "off" }, | |
| 1705 | + { "crnl-glob", 0, 16, 1, "" }, | |
| 1706 | + { "default-perms", 0, 16, 0, "u" }, | |
| 1707 | + { "diff-command", 0, 16, 0, "" }, | |
| 1708 | + { "dont-push", 0, 0, 0, "off" }, | |
| 1709 | + { "editor", 0, 16, 0, "" }, | |
| 1710 | + { "gdiff-command", 0, 16, 0, "gdiff" }, | |
| 1711 | + { "gmerge-command",0, 40, 0, "" }, | |
| 1712 | + { "https-login", 0, 0, 0, "off" }, | |
| 1713 | + { "ignore-glob", 0, 40, 1, "" }, | |
| 1714 | + { "empty-dirs", 0, 40, 1, "" }, | |
| 1715 | + { "http-port", 0, 16, 0, "8080" }, | |
| 1716 | + { "localauth", 0, 0, 0, "off" }, | |
| 1717 | + { "main-branch", 0, 40, 0, "trunk" }, | |
| 1718 | + { "manifest", 0, 0, 1, "off" }, | |
| 1719 | + { "max-upload", 0, 25, 0, "250000" }, | |
| 1720 | + { "mtime-changes", 0, 0, 0, "on" }, | |
| 1721 | + { "pgp-command", 0, 32, 0, "gpg --clearsign -o " }, | |
| 1722 | + { "proxy", 0, 32, 0, "off" }, | |
| 1723 | + { "repo-cksum", 0, 0, 0, "on" }, | |
| 1724 | + { "self-register", 0, 0, 0, "off" }, | |
| 1725 | + { "ssh-command", 0, 32, 0, "" }, | |
| 1726 | + { "web-browser", 0, 32, 0, "" }, | |
| 1727 | + { 0,0,0,0,0 } | |
| 1718 | 1728 | }; |
| 1719 | 1729 | |
| 1720 | 1730 | /* |
| 1721 | 1731 | ** COMMAND: settings |
| 1722 | 1732 | ** COMMAND: unset |
| @@ -1725,10 +1735,14 @@ | ||
| 1725 | 1735 | ** %fossil unset PROPERTY ?-global? |
| 1726 | 1736 | ** |
| 1727 | 1737 | ** The "settings" command with no arguments lists all properties and their |
| 1728 | 1738 | ** values. With just a property name it shows the value of that property. |
| 1729 | 1739 | ** With a value argument it changes the property for the current repository. |
| 1740 | +** | |
| 1741 | +** Settings marked as versionable are overridden by the contents of the | |
| 1742 | +** file named .fossil-settings/PROPERTY in the checked out files, if that | |
| 1743 | +** file exists. | |
| 1730 | 1744 | ** |
| 1731 | 1745 | ** The "unset" command clears a property setting. |
| 1732 | 1746 | ** |
| 1733 | 1747 | ** |
| 1734 | 1748 | ** auto-captcha If enabled, the Login page provides a button to |
| @@ -1742,20 +1756,20 @@ | ||
| 1742 | 1756 | ** or update and automatically push after commit or |
| 1743 | 1757 | ** tag or branch creation. If the value is "pullonly" |
| 1744 | 1758 | ** then only pull operations occur automatically. |
| 1745 | 1759 | ** Default: on |
| 1746 | 1760 | ** |
| 1747 | -** binary-glob The VALUE is a comma-separated list of GLOB patterns | |
| 1748 | -** that should be treated as binary files for merging | |
| 1749 | -** purposes. Example: *.xml | |
| 1761 | +** binary-glob The VALUE is a comma or newline-separated list of | |
| 1762 | +** (versionable) GLOB patterns that should be treated as binary files | |
| 1763 | +** for merging purposes. Example: *.xml | |
| 1750 | 1764 | ** |
| 1751 | 1765 | ** clearsign When enabled, fossil will attempt to sign all commits |
| 1752 | 1766 | ** with gpg. When disabled (the default), commits will |
| 1753 | 1767 | ** be unsigned. Default: off |
| 1754 | 1768 | ** |
| 1755 | -** crnl-glob A comma-separated list of GLOB patterns for text files | |
| 1756 | -** in which it is ok to have CR+NL line endings. | |
| 1769 | +** crnl-glob A comma or newline-separated list of GLOB patterns for | |
| 1770 | +** (versionable) text files in which it is ok to have CR+NL line endings. | |
| 1757 | 1771 | ** Set to "*" to disable CR+NL checking. |
| 1758 | 1772 | ** |
| 1759 | 1773 | ** default-perms Permissions given automatically to new users. For more |
| 1760 | 1774 | ** information on permissions see Users page in Server |
| 1761 | 1775 | ** Administration of the HTTP UI. Default: u. |
| @@ -1781,23 +1795,23 @@ | ||
| 1781 | 1795 | ** and "ui" commands. Default: 8080 |
| 1782 | 1796 | ** |
| 1783 | 1797 | ** https-login Send login creditials using HTTPS instead of HTTP |
| 1784 | 1798 | ** even if the login page request came via HTTP. |
| 1785 | 1799 | ** |
| 1786 | -** ignore-glob The VALUE is a comma-separated list of GLOB patterns | |
| 1787 | -** specifying files that the "extra" command will ignore. | |
| 1788 | -** Example: *.o,*.obj,*.exe | |
| 1800 | +** ignore-glob The VALUE is a comma or newline-separated list of GLOB | |
| 1801 | +** (versionable) patterns specifying files that the "extra" command will | |
| 1802 | +** ignore. Example: *.o,*.obj,*.exe | |
| 1789 | 1803 | ** |
| 1790 | 1804 | ** localauth If enabled, require that HTTP connections from |
| 1791 | 1805 | ** 127.0.0.1 be authenticated by password. If |
| 1792 | 1806 | ** false, all HTTP requests from localhost have |
| 1793 | 1807 | ** unrestricted access to the repository. |
| 1794 | 1808 | ** |
| 1795 | 1809 | ** main-branch The primary branch for the project. Default: trunk |
| 1796 | 1810 | ** |
| 1797 | 1811 | ** manifest If enabled, automatically create files "manifest" and |
| 1798 | -** "manifest.uuid" in every checkout. The SQLite and | |
| 1812 | +** (versionable) "manifest.uuid" in every checkout. The SQLite and | |
| 1799 | 1813 | ** Fossil repositories both require this. Default: off. |
| 1800 | 1814 | ** |
| 1801 | 1815 | ** max-upload A limit on the size of uplink HTTP requests. The |
| 1802 | 1816 | ** default is 250000 bytes. |
| 1803 | 1817 | ** |
| @@ -1843,12 +1857,13 @@ | ||
| 1843 | 1857 | } |
| 1844 | 1858 | if( unsetFlag && g.argc!=3 ){ |
| 1845 | 1859 | usage("PROPERTY ?-global?"); |
| 1846 | 1860 | } |
| 1847 | 1861 | if( g.argc==2 ){ |
| 1862 | + int openLocal = db_open_local(); | |
| 1848 | 1863 | for(i=0; ctrlSettings[i].name; i++){ |
| 1849 | - print_setting(ctrlSettings[i].name); | |
| 1864 | + print_setting(&ctrlSettings[i], openLocal); | |
| 1850 | 1865 | } |
| 1851 | 1866 | }else if( g.argc==3 || g.argc==4 ){ |
| 1852 | 1867 | const char *zName = g.argv[2]; |
| 1853 | 1868 | int isManifest; |
| 1854 | 1869 | int n = strlen(zName); |
| @@ -1866,11 +1881,11 @@ | ||
| 1866 | 1881 | db_unset(ctrlSettings[i].name, globalFlag); |
| 1867 | 1882 | }else if( g.argc==4 ){ |
| 1868 | 1883 | db_set(ctrlSettings[i].name, g.argv[3], globalFlag); |
| 1869 | 1884 | }else{ |
| 1870 | 1885 | isManifest = 0; |
| 1871 | - print_setting(ctrlSettings[i].name); | |
| 1886 | + print_setting(&ctrlSettings[i], db_open_local()); | |
| 1872 | 1887 | } |
| 1873 | 1888 | if( isManifest ){ |
| 1874 | 1889 | manifest_to_disk(db_lget_int("checkout", 0)); |
| 1875 | 1890 | } |
| 1876 | 1891 | }else{ |
| 1877 | 1892 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1641,30 +1641,39 @@ | |
| 1641 | } |
| 1642 | |
| 1643 | /* |
| 1644 | ** Print the value of a setting named zName |
| 1645 | */ |
| 1646 | static void print_setting(const char *zName){ |
| 1647 | Stmt q; |
| 1648 | if( g.repositoryOpen ){ |
| 1649 | db_prepare(&q, |
| 1650 | "SELECT '(local)', value FROM config WHERE name=%Q" |
| 1651 | " UNION ALL " |
| 1652 | "SELECT '(global)', value FROM global_config WHERE name=%Q", |
| 1653 | zName, zName |
| 1654 | ); |
| 1655 | }else{ |
| 1656 | db_prepare(&q, |
| 1657 | "SELECT '(global)', value FROM global_config WHERE name=%Q", |
| 1658 | zName |
| 1659 | ); |
| 1660 | } |
| 1661 | if( db_step(&q)==SQLITE_ROW ){ |
| 1662 | fossil_print("%-20s %-8s %s\n", zName, db_column_text(&q, 0), |
| 1663 | db_column_text(&q, 1)); |
| 1664 | }else{ |
| 1665 | fossil_print("%-20s\n", zName); |
| 1666 | } |
| 1667 | db_finalize(&q); |
| 1668 | } |
| 1669 | |
| 1670 | |
| @@ -1680,43 +1689,44 @@ | |
| 1680 | #if INTERFACE |
| 1681 | struct stControlSettings { |
| 1682 | char const *name; /* Name of the setting */ |
| 1683 | char const *var; /* Internal variable name used by db_set() */ |
| 1684 | int width; /* Width of display. 0 for boolean values */ |
| 1685 | char const *def; /* Default value */ |
| 1686 | }; |
| 1687 | #endif /* INTERFACE */ |
| 1688 | struct stControlSettings const ctrlSettings[] = { |
| 1689 | { "access-log", 0, 0, "off" }, |
| 1690 | { "auto-captcha", "autocaptcha", 0, "on" }, |
| 1691 | { "auto-shun", 0, 0, "on" }, |
| 1692 | { "autosync", 0, 0, "on" }, |
| 1693 | { "binary-glob", 0, 32, "" }, |
| 1694 | { "clearsign", 0, 0, "off" }, |
| 1695 | { "crnl-glob", 0, 16, "" }, |
| 1696 | { "default-perms", 0, 16, "u" }, |
| 1697 | { "diff-command", 0, 16, "" }, |
| 1698 | { "dont-push", 0, 0, "off" }, |
| 1699 | { "editor", 0, 16, "" }, |
| 1700 | { "gdiff-command", 0, 16, "gdiff" }, |
| 1701 | { "gmerge-command",0, 40, "" }, |
| 1702 | { "https-login", 0, 0, "off" }, |
| 1703 | { "ignore-glob", 0, 40, "" }, |
| 1704 | { "empty-dirs", 0, 40, "" }, |
| 1705 | { "http-port", 0, 16, "8080" }, |
| 1706 | { "localauth", 0, 0, "off" }, |
| 1707 | { "main-branch", 0, 40, "trunk" }, |
| 1708 | { "manifest", 0, 0, "off" }, |
| 1709 | { "max-upload", 0, 25, "250000" }, |
| 1710 | { "mtime-changes", 0, 0, "on" }, |
| 1711 | { "pgp-command", 0, 32, "gpg --clearsign -o " }, |
| 1712 | { "proxy", 0, 32, "off" }, |
| 1713 | { "repo-cksum", 0, 0, "on" }, |
| 1714 | { "self-register", 0, 0, "off" }, |
| 1715 | { "ssh-command", 0, 32, "" }, |
| 1716 | { "web-browser", 0, 32, "" }, |
| 1717 | { 0,0,0,0 } |
| 1718 | }; |
| 1719 | |
| 1720 | /* |
| 1721 | ** COMMAND: settings |
| 1722 | ** COMMAND: unset |
| @@ -1725,10 +1735,14 @@ | |
| 1725 | ** %fossil unset PROPERTY ?-global? |
| 1726 | ** |
| 1727 | ** The "settings" command with no arguments lists all properties and their |
| 1728 | ** values. With just a property name it shows the value of that property. |
| 1729 | ** With a value argument it changes the property for the current repository. |
| 1730 | ** |
| 1731 | ** The "unset" command clears a property setting. |
| 1732 | ** |
| 1733 | ** |
| 1734 | ** auto-captcha If enabled, the Login page provides a button to |
| @@ -1742,20 +1756,20 @@ | |
| 1742 | ** or update and automatically push after commit or |
| 1743 | ** tag or branch creation. If the value is "pullonly" |
| 1744 | ** then only pull operations occur automatically. |
| 1745 | ** Default: on |
| 1746 | ** |
| 1747 | ** binary-glob The VALUE is a comma-separated list of GLOB patterns |
| 1748 | ** that should be treated as binary files for merging |
| 1749 | ** purposes. Example: *.xml |
| 1750 | ** |
| 1751 | ** clearsign When enabled, fossil will attempt to sign all commits |
| 1752 | ** with gpg. When disabled (the default), commits will |
| 1753 | ** be unsigned. Default: off |
| 1754 | ** |
| 1755 | ** crnl-glob A comma-separated list of GLOB patterns for text files |
| 1756 | ** in which it is ok to have CR+NL line endings. |
| 1757 | ** Set to "*" to disable CR+NL checking. |
| 1758 | ** |
| 1759 | ** default-perms Permissions given automatically to new users. For more |
| 1760 | ** information on permissions see Users page in Server |
| 1761 | ** Administration of the HTTP UI. Default: u. |
| @@ -1781,23 +1795,23 @@ | |
| 1781 | ** and "ui" commands. Default: 8080 |
| 1782 | ** |
| 1783 | ** https-login Send login creditials using HTTPS instead of HTTP |
| 1784 | ** even if the login page request came via HTTP. |
| 1785 | ** |
| 1786 | ** ignore-glob The VALUE is a comma-separated list of GLOB patterns |
| 1787 | ** specifying files that the "extra" command will ignore. |
| 1788 | ** Example: *.o,*.obj,*.exe |
| 1789 | ** |
| 1790 | ** localauth If enabled, require that HTTP connections from |
| 1791 | ** 127.0.0.1 be authenticated by password. If |
| 1792 | ** false, all HTTP requests from localhost have |
| 1793 | ** unrestricted access to the repository. |
| 1794 | ** |
| 1795 | ** main-branch The primary branch for the project. Default: trunk |
| 1796 | ** |
| 1797 | ** manifest If enabled, automatically create files "manifest" and |
| 1798 | ** "manifest.uuid" in every checkout. The SQLite and |
| 1799 | ** Fossil repositories both require this. Default: off. |
| 1800 | ** |
| 1801 | ** max-upload A limit on the size of uplink HTTP requests. The |
| 1802 | ** default is 250000 bytes. |
| 1803 | ** |
| @@ -1843,12 +1857,13 @@ | |
| 1843 | } |
| 1844 | if( unsetFlag && g.argc!=3 ){ |
| 1845 | usage("PROPERTY ?-global?"); |
| 1846 | } |
| 1847 | if( g.argc==2 ){ |
| 1848 | for(i=0; ctrlSettings[i].name; i++){ |
| 1849 | print_setting(ctrlSettings[i].name); |
| 1850 | } |
| 1851 | }else if( g.argc==3 || g.argc==4 ){ |
| 1852 | const char *zName = g.argv[2]; |
| 1853 | int isManifest; |
| 1854 | int n = strlen(zName); |
| @@ -1866,11 +1881,11 @@ | |
| 1866 | db_unset(ctrlSettings[i].name, globalFlag); |
| 1867 | }else if( g.argc==4 ){ |
| 1868 | db_set(ctrlSettings[i].name, g.argv[3], globalFlag); |
| 1869 | }else{ |
| 1870 | isManifest = 0; |
| 1871 | print_setting(ctrlSettings[i].name); |
| 1872 | } |
| 1873 | if( isManifest ){ |
| 1874 | manifest_to_disk(db_lget_int("checkout", 0)); |
| 1875 | } |
| 1876 | }else{ |
| 1877 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1641,30 +1641,39 @@ | |
| 1641 | } |
| 1642 | |
| 1643 | /* |
| 1644 | ** Print the value of a setting named zName |
| 1645 | */ |
| 1646 | static void print_setting(const struct stControlSettings *ctrlSetting, int localOpen){ |
| 1647 | Stmt q; |
| 1648 | if( g.repositoryOpen ){ |
| 1649 | db_prepare(&q, |
| 1650 | "SELECT '(local)', value FROM config WHERE name=%Q" |
| 1651 | " UNION ALL " |
| 1652 | "SELECT '(global)', value FROM global_config WHERE name=%Q", |
| 1653 | ctrlSetting->name, ctrlSetting->name |
| 1654 | ); |
| 1655 | }else{ |
| 1656 | db_prepare(&q, |
| 1657 | "SELECT '(global)', value FROM global_config WHERE name=%Q", |
| 1658 | ctrlSetting->name |
| 1659 | ); |
| 1660 | } |
| 1661 | if( db_step(&q)==SQLITE_ROW ){ |
| 1662 | fossil_print("%-20s %-8s %s\n", ctrlSetting->name, db_column_text(&q, 0), |
| 1663 | db_column_text(&q, 1)); |
| 1664 | }else{ |
| 1665 | fossil_print("%-20s\n", ctrlSetting->name); |
| 1666 | } |
| 1667 | if( ctrlSetting->versionable && localOpen ){ |
| 1668 | /* Check to see if this is overridden by a versionable settings file */ |
| 1669 | Blob versionedPathname; |
| 1670 | blob_zero(&versionedPathname); |
| 1671 | blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", g.zLocalRoot, ctrlSetting->name); |
| 1672 | if( file_size(blob_str(&versionedPathname))>=0 ){ |
| 1673 | fossil_print(" (overridden by contents of file .fossil-settings/%s)\n", ctrlSetting->name); |
| 1674 | } |
| 1675 | } |
| 1676 | db_finalize(&q); |
| 1677 | } |
| 1678 | |
| 1679 | |
| @@ -1680,43 +1689,44 @@ | |
| 1689 | #if INTERFACE |
| 1690 | struct stControlSettings { |
| 1691 | char const *name; /* Name of the setting */ |
| 1692 | char const *var; /* Internal variable name used by db_set() */ |
| 1693 | int width; /* Width of display. 0 for boolean values */ |
| 1694 | int versionable; /* Is this setting versionable? */ |
| 1695 | char const *def; /* Default value */ |
| 1696 | }; |
| 1697 | #endif /* INTERFACE */ |
| 1698 | struct stControlSettings const ctrlSettings[] = { |
| 1699 | { "access-log", 0, 0, 0, "off" }, |
| 1700 | { "auto-captcha", "autocaptcha", 0, 0, "on" }, |
| 1701 | { "auto-shun", 0, 0, 0, "on" }, |
| 1702 | { "autosync", 0, 0, 0, "on" }, |
| 1703 | { "binary-glob", 0, 32, 1, "" }, |
| 1704 | { "clearsign", 0, 0, 0, "off" }, |
| 1705 | { "crnl-glob", 0, 16, 1, "" }, |
| 1706 | { "default-perms", 0, 16, 0, "u" }, |
| 1707 | { "diff-command", 0, 16, 0, "" }, |
| 1708 | { "dont-push", 0, 0, 0, "off" }, |
| 1709 | { "editor", 0, 16, 0, "" }, |
| 1710 | { "gdiff-command", 0, 16, 0, "gdiff" }, |
| 1711 | { "gmerge-command",0, 40, 0, "" }, |
| 1712 | { "https-login", 0, 0, 0, "off" }, |
| 1713 | { "ignore-glob", 0, 40, 1, "" }, |
| 1714 | { "empty-dirs", 0, 40, 1, "" }, |
| 1715 | { "http-port", 0, 16, 0, "8080" }, |
| 1716 | { "localauth", 0, 0, 0, "off" }, |
| 1717 | { "main-branch", 0, 40, 0, "trunk" }, |
| 1718 | { "manifest", 0, 0, 1, "off" }, |
| 1719 | { "max-upload", 0, 25, 0, "250000" }, |
| 1720 | { "mtime-changes", 0, 0, 0, "on" }, |
| 1721 | { "pgp-command", 0, 32, 0, "gpg --clearsign -o " }, |
| 1722 | { "proxy", 0, 32, 0, "off" }, |
| 1723 | { "repo-cksum", 0, 0, 0, "on" }, |
| 1724 | { "self-register", 0, 0, 0, "off" }, |
| 1725 | { "ssh-command", 0, 32, 0, "" }, |
| 1726 | { "web-browser", 0, 32, 0, "" }, |
| 1727 | { 0,0,0,0,0 } |
| 1728 | }; |
| 1729 | |
| 1730 | /* |
| 1731 | ** COMMAND: settings |
| 1732 | ** COMMAND: unset |
| @@ -1725,10 +1735,14 @@ | |
| 1735 | ** %fossil unset PROPERTY ?-global? |
| 1736 | ** |
| 1737 | ** The "settings" command with no arguments lists all properties and their |
| 1738 | ** values. With just a property name it shows the value of that property. |
| 1739 | ** With a value argument it changes the property for the current repository. |
| 1740 | ** |
| 1741 | ** Settings marked as versionable are overridden by the contents of the |
| 1742 | ** file named .fossil-settings/PROPERTY in the checked out files, if that |
| 1743 | ** file exists. |
| 1744 | ** |
| 1745 | ** The "unset" command clears a property setting. |
| 1746 | ** |
| 1747 | ** |
| 1748 | ** auto-captcha If enabled, the Login page provides a button to |
| @@ -1742,20 +1756,20 @@ | |
| 1756 | ** or update and automatically push after commit or |
| 1757 | ** tag or branch creation. If the value is "pullonly" |
| 1758 | ** then only pull operations occur automatically. |
| 1759 | ** Default: on |
| 1760 | ** |
| 1761 | ** binary-glob The VALUE is a comma or newline-separated list of |
| 1762 | ** (versionable) GLOB patterns that should be treated as binary files |
| 1763 | ** for merging purposes. Example: *.xml |
| 1764 | ** |
| 1765 | ** clearsign When enabled, fossil will attempt to sign all commits |
| 1766 | ** with gpg. When disabled (the default), commits will |
| 1767 | ** be unsigned. Default: off |
| 1768 | ** |
| 1769 | ** crnl-glob A comma or newline-separated list of GLOB patterns for |
| 1770 | ** (versionable) text files in which it is ok to have CR+NL line endings. |
| 1771 | ** Set to "*" to disable CR+NL checking. |
| 1772 | ** |
| 1773 | ** default-perms Permissions given automatically to new users. For more |
| 1774 | ** information on permissions see Users page in Server |
| 1775 | ** Administration of the HTTP UI. Default: u. |
| @@ -1781,23 +1795,23 @@ | |
| 1795 | ** and "ui" commands. Default: 8080 |
| 1796 | ** |
| 1797 | ** https-login Send login creditials using HTTPS instead of HTTP |
| 1798 | ** even if the login page request came via HTTP. |
| 1799 | ** |
| 1800 | ** ignore-glob The VALUE is a comma or newline-separated list of GLOB |
| 1801 | ** (versionable) patterns specifying files that the "extra" command will |
| 1802 | ** ignore. Example: *.o,*.obj,*.exe |
| 1803 | ** |
| 1804 | ** localauth If enabled, require that HTTP connections from |
| 1805 | ** 127.0.0.1 be authenticated by password. If |
| 1806 | ** false, all HTTP requests from localhost have |
| 1807 | ** unrestricted access to the repository. |
| 1808 | ** |
| 1809 | ** main-branch The primary branch for the project. Default: trunk |
| 1810 | ** |
| 1811 | ** manifest If enabled, automatically create files "manifest" and |
| 1812 | ** (versionable) "manifest.uuid" in every checkout. The SQLite and |
| 1813 | ** Fossil repositories both require this. Default: off. |
| 1814 | ** |
| 1815 | ** max-upload A limit on the size of uplink HTTP requests. The |
| 1816 | ** default is 250000 bytes. |
| 1817 | ** |
| @@ -1843,12 +1857,13 @@ | |
| 1857 | } |
| 1858 | if( unsetFlag && g.argc!=3 ){ |
| 1859 | usage("PROPERTY ?-global?"); |
| 1860 | } |
| 1861 | if( g.argc==2 ){ |
| 1862 | int openLocal = db_open_local(); |
| 1863 | for(i=0; ctrlSettings[i].name; i++){ |
| 1864 | print_setting(&ctrlSettings[i], openLocal); |
| 1865 | } |
| 1866 | }else if( g.argc==3 || g.argc==4 ){ |
| 1867 | const char *zName = g.argv[2]; |
| 1868 | int isManifest; |
| 1869 | int n = strlen(zName); |
| @@ -1866,11 +1881,11 @@ | |
| 1881 | db_unset(ctrlSettings[i].name, globalFlag); |
| 1882 | }else if( g.argc==4 ){ |
| 1883 | db_set(ctrlSettings[i].name, g.argv[3], globalFlag); |
| 1884 | }else{ |
| 1885 | isManifest = 0; |
| 1886 | print_setting(&ctrlSettings[i], db_open_local()); |
| 1887 | } |
| 1888 | if( isManifest ){ |
| 1889 | manifest_to_disk(db_lget_int("checkout", 0)); |
| 1890 | } |
| 1891 | }else{ |
| 1892 |
+11
-2
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1062,25 +1062,34 @@ | ||
| 1062 | 1062 | for(pSet=ctrlSettings; pSet->name!=0; pSet++){ |
| 1063 | 1063 | if( pSet->width==0 ){ |
| 1064 | 1064 | onoff_attribute(pSet->name, pSet->name, |
| 1065 | 1065 | pSet->var!=0 ? pSet->var : pSet->name, |
| 1066 | 1066 | is_truth(pSet->def)); |
| 1067 | - @ <br /> | |
| 1067 | + if( pSet->versionable ){ | |
| 1068 | + @ (v)<br /> | |
| 1069 | + } else { | |
| 1070 | + @ <br /> | |
| 1071 | + } | |
| 1068 | 1072 | } |
| 1069 | 1073 | } |
| 1070 | 1074 | @ </td><td style="width: 30;"></td><td valign="top"> |
| 1071 | 1075 | for(pSet=ctrlSettings; pSet->name!=0; pSet++){ |
| 1072 | 1076 | if( pSet->width!=0 ){ |
| 1073 | 1077 | entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name, |
| 1074 | 1078 | pSet->var!=0 ? pSet->var : pSet->name, |
| 1075 | 1079 | (char*)pSet->def); |
| 1076 | - @ <br /> | |
| 1080 | + if( pSet->versionable ){ | |
| 1081 | + @ (v)<br /> | |
| 1082 | + } else { | |
| 1083 | + @ <br /> | |
| 1084 | + } | |
| 1077 | 1085 | } |
| 1078 | 1086 | } |
| 1079 | 1087 | @ </td></tr></table> |
| 1080 | 1088 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 1081 | 1089 | @ </div></form> |
| 1090 | + @ <p>Settings marked with (v) are 'versionable' and will be overridden by the contents of files named <tt>.fossil-settings/PROPERTY</tt>.</p> | |
| 1082 | 1091 | @ <hr /><p> |
| 1083 | 1092 | @ These settings work in the same way, as the <kbd>set</kbd> commandline:<br /> |
| 1084 | 1093 | @ </p><pre>%s(zHelp_setting_cmd)</pre> |
| 1085 | 1094 | db_end_transaction(0); |
| 1086 | 1095 | style_footer(); |
| 1087 | 1096 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1062,25 +1062,34 @@ | |
| 1062 | for(pSet=ctrlSettings; pSet->name!=0; pSet++){ |
| 1063 | if( pSet->width==0 ){ |
| 1064 | onoff_attribute(pSet->name, pSet->name, |
| 1065 | pSet->var!=0 ? pSet->var : pSet->name, |
| 1066 | is_truth(pSet->def)); |
| 1067 | @ <br /> |
| 1068 | } |
| 1069 | } |
| 1070 | @ </td><td style="width: 30;"></td><td valign="top"> |
| 1071 | for(pSet=ctrlSettings; pSet->name!=0; pSet++){ |
| 1072 | if( pSet->width!=0 ){ |
| 1073 | entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name, |
| 1074 | pSet->var!=0 ? pSet->var : pSet->name, |
| 1075 | (char*)pSet->def); |
| 1076 | @ <br /> |
| 1077 | } |
| 1078 | } |
| 1079 | @ </td></tr></table> |
| 1080 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 1081 | @ </div></form> |
| 1082 | @ <hr /><p> |
| 1083 | @ These settings work in the same way, as the <kbd>set</kbd> commandline:<br /> |
| 1084 | @ </p><pre>%s(zHelp_setting_cmd)</pre> |
| 1085 | db_end_transaction(0); |
| 1086 | style_footer(); |
| 1087 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1062,25 +1062,34 @@ | |
| 1062 | for(pSet=ctrlSettings; pSet->name!=0; pSet++){ |
| 1063 | if( pSet->width==0 ){ |
| 1064 | onoff_attribute(pSet->name, pSet->name, |
| 1065 | pSet->var!=0 ? pSet->var : pSet->name, |
| 1066 | is_truth(pSet->def)); |
| 1067 | if( pSet->versionable ){ |
| 1068 | @ (v)<br /> |
| 1069 | } else { |
| 1070 | @ <br /> |
| 1071 | } |
| 1072 | } |
| 1073 | } |
| 1074 | @ </td><td style="width: 30;"></td><td valign="top"> |
| 1075 | for(pSet=ctrlSettings; pSet->name!=0; pSet++){ |
| 1076 | if( pSet->width!=0 ){ |
| 1077 | entry_attribute(pSet->name, /*pSet->width*/ 40, pSet->name, |
| 1078 | pSet->var!=0 ? pSet->var : pSet->name, |
| 1079 | (char*)pSet->def); |
| 1080 | if( pSet->versionable ){ |
| 1081 | @ (v)<br /> |
| 1082 | } else { |
| 1083 | @ <br /> |
| 1084 | } |
| 1085 | } |
| 1086 | } |
| 1087 | @ </td></tr></table> |
| 1088 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 1089 | @ </div></form> |
| 1090 | @ <p>Settings marked with (v) are 'versionable' and will be overridden by the contents of files named <tt>.fossil-settings/PROPERTY</tt>.</p> |
| 1091 | @ <hr /><p> |
| 1092 | @ These settings work in the same way, as the <kbd>set</kbd> commandline:<br /> |
| 1093 | @ </p><pre>%s(zHelp_setting_cmd)</pre> |
| 1094 | db_end_transaction(0); |
| 1095 | style_footer(); |
| 1096 |