This vendors backups extension from hg-experimental.
Listing backups and having some utility to apply them is nice. I know we have
obsmarkers now, but this will help a lot of end users who still uses strip until
we get evolve out of experimental.
This vendors backups extension from hg-experimental.
Listing backups and having some utility to apply them is nice. I know we have
obsmarkers now, but this will help a lot of end users who still uses strip until
we get evolve out of experimental.
Lint Skipped |
Unit Tests Skipped |
I know this has already been queue and I'm just slow, but could you send follow-up patches to address my comments?
mercurial/debugcommands.py | ||
---|---|---|
3497 | Do we really want to support all of these? (FYI, they include --stat, --graph, --style, --patch, and a few more.) | |
3513 | I think Windows doesn't care much about / vs \, but should we ideally use os.path.join(..., ".hg") here? | |
3517 | Clearer to pass bundlename="" in the call to getremotechanges()? | |
3518 | Clearer to pass force=None (or False?) in the call to getremotechanges()? | |
3522 | Always false, so delete it? | |
3599–3609 | Perhaps the template here should apply at the bundle level instead of the changeset level, so the user can also template the date (and maybe bundle name). | |
3609 | heh, status.modified seems like quite an abuse of the labeling system (I assume it was picked because the author thought that the color they had configured for that looked good in this context too). Could you switch to a different label? | |
3611 | Does False (for the differ argument) produce different output than the default (None) would? If not, remove the False? If it does, could you pass it as a keyword argument instead (differ=False)? |
mercurial/debugcommands.py | ||
---|---|---|
3513 | I thought we were trying to avoid os.path, so maybe just repo.vfs.join("strip-backup", ".hg")? (And don't these need to be b'' prefixed for py3?) |
mercurial/debugcommands.py | ||
---|---|---|
3513 | +1 on using vfs here, this is the abstraction we use everywhere else. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/debugcommands.py (133 lines) | |||
A | M | tests/test-debugbackup.t (36 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
937e7fbd7e8c | 98349eddceef | Pulkit Goyal | Jan 17 2020, 1:22 PM |
$ cat >> $HGRCPATH << EOF | |||||
> [extensions] | |||||
> strip= | |||||
> EOF | |||||
Setup repo | |||||
$ hg init repo | |||||
$ cd repo | |||||
Test backups list and recover | |||||
$ mkcommit() { | |||||
> echo "$1" > "$1" | |||||
> hg add "$1" | |||||
> hg ci -l $1 | |||||
> } | |||||
$ mkcommit a | |||||
$ mkcommit b | |||||
$ hg strip . | |||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||||
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d2ae7f538514-2953539b-backup.hg (glob) | |||||
$ hg debugbackups | |||||
Recover changesets using: hg debugbackups --recover <changeset hash> | |||||
Available backup changesets: | |||||
* (glob) | |||||
d2ae7f538514 b | |||||
$ hg debugbackups --recover d2ae7f538514 | |||||
Unbundling d2ae7f538514 | |||||
adding changesets | |||||
adding manifests | |||||
adding file changes | |||||
added 1 changesets with 1 changes to 1 files | |||||
new changesets d2ae7f538514 (1 drafts) |
Do we really want to support all of these? (FYI, they include --stat, --graph, --style, --patch, and a few more.)