fastforward
Functionality for removing backups from a repo's history
delete_backups(repo_root, *revisions)
Delete the specified backups
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repo_root
|
Path
|
The directory containing the GSB-managed repo |
required |
*revisions
|
str
|
The commit hashes and tag names of the backups to delete |
()
|
Returns:
Type | Description |
---|---|
str
|
The tag name or commit hash for the most recent backup in the rewritten history |
Notes
- The current repo state will always be kept (and, in the case that there are un-backed-up changes, those changes will be backed up before the history is rewritten).
- Deleting the initial backup is not currently supported.
Raises:
Type | Description |
---|---|
OSError
|
If the specified repo does not exist or is not a gsb-managed repo |
ValueError
|
If the specified revision does not exist |
Source code in gsb/fastforward.py
rewrite_history(repo_root, starting_point, *revisions)
Rewrite the repo's history by only including the specified backups, effectively deleting the ones in between
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repo_root
|
Path
|
The directory containing the GSB-managed repo |
required |
starting_point
|
str
|
The commit hash or tag name to start revising from (all prior backups will be kept) |
required |
*revisions
|
str
|
The commit hashes / tag names for the backups that should be included / kept in the new history |
()
|
Returns:
Type | Description |
---|---|
str
|
The tag name or commit hash for the most recent backup in the rewritten history |
Notes
- The current repo state will always be kept (and, in the case that there are un-backed-up changes, those changes will be backed up before the history is rewritten).
- The ordering of the provided revisions is not checked in advance, nor is anything done to check for duplicates. Providing the backups out-of-order will create a new history that frames the backups in the order provided.
Raises:
Type | Description |
---|---|
OSError
|
If the specified repo does not exist or is not a gsb-managed repo |
ValueError
|
If any of the specified revisions do not exist |
Source code in gsb/fastforward.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|