Add support for history --merge to incorporate history changes from

other sessions.

Fixes #825
This commit is contained in:
ridiculousfish
2014-07-25 10:08:21 -07:00
parent 317660c2fe
commit e9f870e25a
5 changed files with 68 additions and 8 deletions

View File

@@ -154,8 +154,8 @@ class history_t
/** The file ID of the file we mmap'd */
file_id_t mmap_file_id;
/** Timestamp of when this history was created */
const time_t birth_timestamp;
/** The boundary timestamp distinguishes old items from new items. Items whose timestamps are <= the boundary are considered "old". Items whose timestemps are > the boundary are new, and are ignored by this instance (unless they came from this instance). The timestamp may be adjusted by incorporate_external_changes() */
time_t boundary_timestamp;
/** How many items we add until the next vacuum. Initially a random value. */
int countdown_to_vacuum;
@@ -233,6 +233,9 @@ class history_t
/** Populates from a bash history file */
void populate_from_bash(FILE *f);
/** Incorporates the history of other shells into this history */
void incorporate_external_changes();
/* Gets all the history into a string with ARRAY_SEP_STR. This is intended for the $history environment variable. This may be long! */
void get_string_representation(wcstring &str, const wcstring &separator);