Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add '--no-prompt' option to the 'commit' command. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
29ef4f5d06f9a73f7423c5705718073f |
| User & Date: | mistachkin 2016-09-13 22:14:41.731 |
Context
|
2016-09-14
| ||
| 01:42 | Fix typo in comment. check-in: a3d8b27b45 user: mistachkin tags: trunk | |
|
2016-09-13
| ||
| 22:14 | Add '--no-prompt' option to the 'commit' command. check-in: 29ef4f5d06 user: mistachkin tags: trunk | |
| 22:13 | Pass the command flags into the TH1 hooks verbatim, without any masking. check-in: 9595cfcd45 user: mistachkin tags: trunk | |
| 04:35 | Add '--no-prompt' option to the 'commit' command. Closed-Leaf check-in: 4f3f39c4be user: mistachkin tags: commitNoPrompt | |
Changes
Changes to src/checkin.c.
| ︙ | |||
1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 | 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 | + |
** and the original file will have been renamed to "<filename>-original".
*/
static int commit_warning(
Blob *p, /* The content of the file being committed. */
int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
int binOk, /* Non-zero if binary warnings should be disabled. */
int encodingOk, /* Non-zero if encoding warnings should be disabled. */
int noPrompt, /* Non-zero to disable prompts and assume 'No'. */
const char *zFilename /* The full name of the file being committed. */
){
int bReverse; /* UTF-16 byte order is reversed? */
int fUnicode; /* return value of could_be_utf16() */
int fBinary; /* does the blob content appear to be binary? */
int lookFlags; /* output flags from looks_like_utf8/utf16() */
int fHasAnyCr; /* the blob contains one or more CR chars */
|
| ︙ | |||
1560 1561 1562 1563 1564 1565 1566 | 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 | + - + - - + + + + + + |
}
file_relative_name(zFilename, &fname, 0);
zMsg = mprintf(
"%s contains %s. Use --no-warnings or the %s to"
" disable this warning.\n"
"Commit anyhow (a=all/%sy/N)? ",
blob_str(&fname), zWarning, zDisable, zConvert);
if( !noPrompt ){
|
| ︙ | |||
1593 1594 1595 1596 1597 1598 1599 | 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 | - |
fclose(f);
}
return 1;
}else if( cReply!='y' && cReply!='Y' ){
fossil_fatal("Abandoning commit due to %s in %s",
zWarning, blob_str(&fname));
}
|
| ︙ | |||
1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 | 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 | + + + | ** --close close the branch being committed ** --delta use a delta manifest in the commit process ** --integrate close all merged-in branches ** -m|--comment COMMENT-TEXT use COMMENT-TEXT as commit comment ** -M|--message-file FILE read the commit comment from given file ** --mimetype MIMETYPE mimetype of check-in comment ** -n|--dry-run If given, display instead of run actions ** --no-prompt This option disables prompting the user for ** input and assumes an answer of 'No' for every ** question. ** --no-warnings omit all warnings about file contents ** --nosign do not attempt to sign this commit with gpg ** --private do not sync changes and their descendants ** --sha1sum verify file status using SHA1 hashing rather ** than relying on file mtimes ** --tag TAG-NAME assign given tag TAG-NAME to the check-in ** --date-override DATETIME DATE to use instead of 'now' |
| ︙ | |||
1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 | 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 | + | const char *zComment; /* Check-in comment */ Stmt q; /* Various queries */ char *zUuid; /* UUID of the new check-in */ int useSha1sum = 0; /* True to verify file status using SHA1 hashing */ int noSign = 0; /* True to omit signing the manifest using GPG */ int isAMerge = 0; /* True if checking in a merge */ int noWarningFlag = 0; /* True if skipping all warnings */ int noPrompt = 0; /* True if skipping all prompts */ int forceFlag = 0; /* Undocumented: Disables all checks */ int forceDelta = 0; /* Force a delta-manifest */ int forceBaseline = 0; /* Force a baseline-manifest */ int allowConflict = 0; /* Allow unresolve merge conflicts */ int allowEmpty = 0; /* Allow a commit with no changes */ int allowFork = 0; /* Allow the commit to fork */ int allowOlder = 0; /* Allow a commit older than its ancestor */ |
| ︙ | |||
1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 | 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 | + |
}
zComment = find_option("comment","m",1);
forceFlag = find_option("force", "f", 0)!=0;
allowConflict = find_option("allow-conflict",0,0)!=0;
allowEmpty = find_option("allow-empty",0,0)!=0;
allowFork = find_option("allow-fork",0,0)!=0;
allowOlder = find_option("allow-older",0,0)!=0;
noPrompt = find_option("no-prompt", 0, 0)!=0;
noWarningFlag = find_option("no-warnings", 0, 0)!=0;
sCiInfo.zBranch = find_option("branch","b",1);
sCiInfo.zColor = find_option("bgcolor",0,1);
sCiInfo.zBrClr = find_option("branchcolor",0,1);
sCiInfo.closeFlag = find_option("close",0,0)!=0;
sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
sCiInfo.zMimetype = find_option("mimetype",0,1);
|
| ︙ | |||
1827 1828 1829 1830 1831 1832 1833 | 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 | + - - + + + + + + + + - - - + + + + + + + + + |
}
}
/* Require confirmation to continue with the check-in if there is
** clock skew
*/
if( g.clockSkewSeen ){
if( !noPrompt ){
|
| ︙ | |||
1952 1953 1954 1955 1956 1957 1958 | 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 | - + - + + - + + + + - - + + + + + + + |
if( zComment ){
blob_zero(&comment);
blob_append(&comment, zComment, -1);
}else if( zComFile ){
blob_zero(&comment);
blob_read_from_file(&comment, zComFile);
blob_to_utf8_no_bom(&comment, 1);
|
| ︙ | |||
2021 2022 2023 2024 2025 2026 2027 | 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 | - + + |
blob_read_link(&content, zFullname);
}else{
blob_read_from_file(&content, zFullname);
}
/* Do not emit any warnings when they are disabled. */
if( !noWarningFlag ){
abortCommit |= commit_warning(&content, crnlOk, binOk,
|
| ︙ | |||
2105 2106 2107 2108 2109 2110 2111 | 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 | + - - + + + + + + + |
blob_reset(&delta);
}
}else if( forceDelta ){
fossil_fatal("unable to find a baseline-manifest for the delta");
}
}
if( !noSign && !g.markPrivate && clearsign(&manifest, &manifest) ){
if( !noPrompt ){
|
| ︙ |