Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add a TODO comment to the branch_of_file_rid() function. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | artifact-view-links |
| Files: | files | file ages | folders |
| SHA3-256: |
d462f87d8a473b0743f853a807dc840c |
| User & Date: | drh 2020-05-06 11:51:20.284 |
Context
|
2020-05-27
| ||
| 16:02 | Merged trunk changes in ... (check-in: 32f391f655 user: wyoung tags: artifact-view-links) | |
|
2020-05-06
| ||
| 11:51 | Add a TODO comment to the branch_of_file_rid() function. ... (check-in: d462f87d8a user: drh tags: artifact-view-links) | |
| 08:47 | Renamed branch_of_rid() to branch_of_ckin_rid() to disambiguate it from the new branch_of_file_rid() function and to make it clear to callers what parameter type it expects. ... (check-in: da1adac6d1 user: wyoung tags: artifact-view-links) | |
Changes
Changes to src/branch.c.
| ︙ | ︙ | |||
45 46 47 48 49 50 51 |
if( zMain==0 ) zMain = db_get("main-branch",0);
zBr = fossil_strdup(zMain);
}
return zBr;
}
/*
| | > > | > > > > > > > > > > > > > > > > > | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
if( zMain==0 ) zMain = db_get("main-branch",0);
zBr = fossil_strdup(zMain);
}
return zBr;
}
/*
** If RID refers to a file, return the name of one of the branches in which
** the file is used. If the RID file is used in more than one branch, then
** the branch name returned is selected arbitrarily from the available
** choices.
**
** Space to hold the returned value is obtained from fossil_malloc()
** and should be freed by the caller.
**
** TODO:
** Should the "arbitrary" choice of branch be made deterministic?
** Perhaps the algorithm should be:
** 1. Use "trunk" if it is available
** 2. Use select the branch in which the file was first used
** if it is never used in trunk.
** That algorithm can be implemented (I think) by adding:
**
** ... ORDER BY value<>'trunk', tagxref.mtime LIMIT 1
**
** Maybe step 2 of the algorithm should be the most recent use of
** the file rather than the first use? That can be achieved by
** putting a DESC on the second term of the ORDER BY.
*/
char *branch_of_file_rid(int rid){
char *zBr = 0;
static Stmt q;
db_static_prepare(&q,
"SELECT value FROM tagxref, mlink"
" WHERE rid=mlink.mid"
|
| ︙ | ︙ |