Fossil SCM

Allow the setup user to add the chngtime query parameter to ci_edit. This can be used to override incorrect tags that have a date way in the future.

drh 2012-07-25 12:05 trunk
Commit ca72f02c9b7b2c801235ec7b8ab1ac2e35ca773b
1 file changed +14 -1
+14 -1
--- src/info.c
+++ src/info.c
@@ -1797,10 +1797,11 @@
17971797
const char *zNewBrFlag;
17981798
const char *zNewBranch;
17991799
const char *zCloseFlag;
18001800
int fPropagateColor; /* True if color propagates before edit */
18011801
int fNewPropagateColor; /* True if color propagates after edit */
1802
+ const char *zChngTime = 0; /* Value of chngtime= query param, if any */
18021803
char *zUuid;
18031804
Blob comment;
18041805
Stmt q;
18051806
18061807
login_check_credentials();
@@ -1811,10 +1812,11 @@
18111812
" FROM event WHERE objid=%d", rid);
18121813
if( zComment==0 ) fossil_redirect_home();
18131814
if( P("cancel") ){
18141815
cgi_redirectf("ci?name=%s", zUuid);
18151816
}
1817
+ if( g.perm.Setup ) zChngTime = P("chngtime");
18161818
zNewComment = PD("c",zComment);
18171819
zUser = db_text(0, "SELECT coalesce(euser,user)"
18181820
" FROM event WHERE objid=%d", rid);
18191821
if( zUser==0 ) fossil_redirect_home();
18201822
zNewUser = PDT("u",zUser);
@@ -1842,11 +1844,11 @@
18421844
char *zNow;
18431845
int nChng = 0;
18441846
18451847
login_verify_csrf_secret();
18461848
blob_zero(&ctrl);
1847
- zNow = date_in_standard_format("now");
1849
+ zNow = date_in_standard_format(zChngTime ? zChngTime : "now");
18481850
blob_appendf(&ctrl, "D %s\n", zNow);
18491851
db_multi_exec("CREATE TEMP TABLE newtags(tag UNIQUE, prefix, value)");
18501852
if( zNewColor[0]
18511853
&& (fPropagateColor!=fNewPropagateColor
18521854
|| fossil_strcmp(zColor,zNewColor)!=0)
@@ -1968,10 +1970,14 @@
19681970
}
19691971
db_finalize(&q);
19701972
blob_appendf(&suffix, ")");
19711973
@ %s(blob_str(&suffix))
19721974
@ </td></tr></table>
1975
+ if( zChngTime ){
1976
+ @ <p>The timestamp on the tag used to make the changes above
1977
+ @ will be overridden as: %s(date_in_standard_format(zChngTime))</p>
1978
+ }
19731979
@ </blockquote>
19741980
@ <hr />
19751981
blob_reset(&suffix);
19761982
}
19771983
@ <p>Make changes to attributes of check-in
@@ -1993,10 +1999,17 @@
19931999
19942000
@ <tr><td align="right" valign="top"><b>Check-in Time:</b></td>
19952001
@ <td valign="top">
19962002
@ <input type="text" name="dt" size="20" value="%h(zNewDate)" />
19972003
@ </td></tr>
2004
+
2005
+ if( zChngTime ){
2006
+ @ <tr><td align="right" valign="top"><b>Timestamp of this change:</b></td>
2007
+ @ <td valign="top">
2008
+ @ <input type="text" name="chngtime" size="20" value="%h(zChngTime)" />
2009
+ @ </td></tr>
2010
+ }
19982011
19992012
@ <tr><td align="right" valign="top"><b>Background Color:</b></td>
20002013
@ <td valign="top">
20012014
render_color_chooser(fNewPropagateColor, zNewColor, "pclr", "clr", "clrcust");
20022015
@ </td></tr>
20032016
--- src/info.c
+++ src/info.c
@@ -1797,10 +1797,11 @@
1797 const char *zNewBrFlag;
1798 const char *zNewBranch;
1799 const char *zCloseFlag;
1800 int fPropagateColor; /* True if color propagates before edit */
1801 int fNewPropagateColor; /* True if color propagates after edit */
 
1802 char *zUuid;
1803 Blob comment;
1804 Stmt q;
1805
1806 login_check_credentials();
@@ -1811,10 +1812,11 @@
1811 " FROM event WHERE objid=%d", rid);
1812 if( zComment==0 ) fossil_redirect_home();
1813 if( P("cancel") ){
1814 cgi_redirectf("ci?name=%s", zUuid);
1815 }
 
1816 zNewComment = PD("c",zComment);
1817 zUser = db_text(0, "SELECT coalesce(euser,user)"
1818 " FROM event WHERE objid=%d", rid);
1819 if( zUser==0 ) fossil_redirect_home();
1820 zNewUser = PDT("u",zUser);
@@ -1842,11 +1844,11 @@
1842 char *zNow;
1843 int nChng = 0;
1844
1845 login_verify_csrf_secret();
1846 blob_zero(&ctrl);
1847 zNow = date_in_standard_format("now");
1848 blob_appendf(&ctrl, "D %s\n", zNow);
1849 db_multi_exec("CREATE TEMP TABLE newtags(tag UNIQUE, prefix, value)");
1850 if( zNewColor[0]
1851 && (fPropagateColor!=fNewPropagateColor
1852 || fossil_strcmp(zColor,zNewColor)!=0)
@@ -1968,10 +1970,14 @@
1968 }
1969 db_finalize(&q);
1970 blob_appendf(&suffix, ")");
1971 @ %s(blob_str(&suffix))
1972 @ </td></tr></table>
 
 
 
 
1973 @ </blockquote>
1974 @ <hr />
1975 blob_reset(&suffix);
1976 }
1977 @ <p>Make changes to attributes of check-in
@@ -1993,10 +1999,17 @@
1993
1994 @ <tr><td align="right" valign="top"><b>Check-in Time:</b></td>
1995 @ <td valign="top">
1996 @ <input type="text" name="dt" size="20" value="%h(zNewDate)" />
1997 @ </td></tr>
 
 
 
 
 
 
 
1998
1999 @ <tr><td align="right" valign="top"><b>Background Color:</b></td>
2000 @ <td valign="top">
2001 render_color_chooser(fNewPropagateColor, zNewColor, "pclr", "clr", "clrcust");
2002 @ </td></tr>
2003
--- src/info.c
+++ src/info.c
@@ -1797,10 +1797,11 @@
1797 const char *zNewBrFlag;
1798 const char *zNewBranch;
1799 const char *zCloseFlag;
1800 int fPropagateColor; /* True if color propagates before edit */
1801 int fNewPropagateColor; /* True if color propagates after edit */
1802 const char *zChngTime = 0; /* Value of chngtime= query param, if any */
1803 char *zUuid;
1804 Blob comment;
1805 Stmt q;
1806
1807 login_check_credentials();
@@ -1811,10 +1812,11 @@
1812 " FROM event WHERE objid=%d", rid);
1813 if( zComment==0 ) fossil_redirect_home();
1814 if( P("cancel") ){
1815 cgi_redirectf("ci?name=%s", zUuid);
1816 }
1817 if( g.perm.Setup ) zChngTime = P("chngtime");
1818 zNewComment = PD("c",zComment);
1819 zUser = db_text(0, "SELECT coalesce(euser,user)"
1820 " FROM event WHERE objid=%d", rid);
1821 if( zUser==0 ) fossil_redirect_home();
1822 zNewUser = PDT("u",zUser);
@@ -1842,11 +1844,11 @@
1844 char *zNow;
1845 int nChng = 0;
1846
1847 login_verify_csrf_secret();
1848 blob_zero(&ctrl);
1849 zNow = date_in_standard_format(zChngTime ? zChngTime : "now");
1850 blob_appendf(&ctrl, "D %s\n", zNow);
1851 db_multi_exec("CREATE TEMP TABLE newtags(tag UNIQUE, prefix, value)");
1852 if( zNewColor[0]
1853 && (fPropagateColor!=fNewPropagateColor
1854 || fossil_strcmp(zColor,zNewColor)!=0)
@@ -1968,10 +1970,14 @@
1970 }
1971 db_finalize(&q);
1972 blob_appendf(&suffix, ")");
1973 @ %s(blob_str(&suffix))
1974 @ </td></tr></table>
1975 if( zChngTime ){
1976 @ <p>The timestamp on the tag used to make the changes above
1977 @ will be overridden as: %s(date_in_standard_format(zChngTime))</p>
1978 }
1979 @ </blockquote>
1980 @ <hr />
1981 blob_reset(&suffix);
1982 }
1983 @ <p>Make changes to attributes of check-in
@@ -1993,10 +1999,17 @@
1999
2000 @ <tr><td align="right" valign="top"><b>Check-in Time:</b></td>
2001 @ <td valign="top">
2002 @ <input type="text" name="dt" size="20" value="%h(zNewDate)" />
2003 @ </td></tr>
2004
2005 if( zChngTime ){
2006 @ <tr><td align="right" valign="top"><b>Timestamp of this change:</b></td>
2007 @ <td valign="top">
2008 @ <input type="text" name="chngtime" size="20" value="%h(zChngTime)" />
2009 @ </td></tr>
2010 }
2011
2012 @ <tr><td align="right" valign="top"><b>Background Color:</b></td>
2013 @ <td valign="top">
2014 render_color_chooser(fNewPropagateColor, zNewColor, "pclr", "clr", "clrcust");
2015 @ </td></tr>
2016

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button