63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
vid = db_lget_int("checkout", 0);
if( vid==0 ){
fossil_fatal("cannot find current version");
}
if( db_exists("SELECT 1 FROM vmerge") ){
fossil_fatal("cannot update an uncommitted merge");
}
if( g.argc==3 ){
tid = name_to_rid(g.argv[2]);
if( tid==0 ){
fossil_fatal("not a version: %s", g.argv[2]);
}
if( !is_a_version(tid) ){
fossil_fatal("not a version: %s", g.argv[2]);
}
}
/* Do an autosync pull prior to the update, if autosync is on */
autosync(1);
if( tid==0 ){
compute_leaves(vid);
if( !latestFlag && db_int(0, "SELECT count(*) FROM leaves")>1 ){
db_prepare(&q,
"%s "
" AND event.objid IN leaves"
" ORDER BY event.mtime DESC",
|
>
>
>
>
>
|
>
>
>
>
|
|
>
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
vid = db_lget_int("checkout", 0);
if( vid==0 ){
fossil_fatal("cannot find current version");
}
if( db_exists("SELECT 1 FROM vmerge") ){
fossil_fatal("cannot update an uncommitted merge");
}
if( unsaved_changes() && db_get_int("safemerge", 0) ){
fossil_fatal("you have uncommitted changes and safemerge is enabled");
}
if( g.argc==3 ){
tid = name_to_rid(g.argv[2]);
if( tid==0 ){
fossil_fatal("not a version: %s", g.argv[2]);
}
if( !is_a_version(tid) ){
fossil_fatal("not a version: %s", g.argv[2]);
}
}
if( tid==0 ){
/*
** Do an autosync pull prior to the update, if autosync is on and they
** did not want a specific version (i.e. another branch, a past revision).
** By not giving a specific version, they are asking for the latest, thus
** pull to get the latest, then update.
*/
autosync(1);
}
if( tid==0 ){
compute_leaves(vid);
if( !latestFlag && db_int(0, "SELECT count(*) FROM leaves")>1 ){
db_prepare(&q,
"%s "
" AND event.objid IN leaves"
" ORDER BY event.mtime DESC",
|