diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-07-25 10:08:21 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-07-25 10:49:12 -0700 |
commit | e9f870e25af2fb8bf2dfbf5c92faaff667fd4cc1 (patch) | |
tree | 9ff028b8fc75082a7b5a605ea04cbef8036a73b2 /history.h | |
parent | 317660c2fe71dbbb31c85aa313f669f55c2f8df7 (diff) |
Add support for history --merge to incorporate history changes from
other sessions.
Fixes #825
Diffstat (limited to 'history.h')
-rw-r--r-- | history.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -154,8 +154,8 @@ private: /** 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 @@ public: /** 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); |