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.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
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 | ||
---|---|---|
3416 | Do we really want to support all of these? (FYI, they include --stat, --graph, --style, --patch, and a few more.) | |
3432 | I think Windows doesn't care much about / vs \, but should we ideally use os.path.join(..., ".hg") here? | |
3436 | Clearer to pass bundlename="" in the call to getremotechanges()? | |
3437 | Clearer to pass force=None (or False?) in the call to getremotechanges()? | |
3441 | Always false, so delete it? | |
3518–3528 | 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). | |
3528 | 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? | |
3530 | 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 | ||
---|---|---|
3432 | 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 | ||
---|---|---|
3432 | +1 on using vfs here, this is the abstraction we use everywhere else. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/debugcommands.py (134 lines) | |||
A | M | tests/debugbackupbundle.t (39 lines) | ||
M | tests/test-completion.t (2 lines) | |||
M | tests/test-help.t (2 lines) |
$ cat >> $HGRCPATH << EOF | |||||
> [extensions] | |||||
> strip= | |||||
> EOF | |||||
Setup repo | |||||
$ hg init repo | |||||
$ cd repo | |||||
Test backups list and recover | |||||
$ hg debugbackupbundle | |||||
no backup changesets found | |||||
$ 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 debugbackupbundle | |||||
Recover changesets using: hg debugbackupbundle --recover <changeset hash> | |||||
Available backup changesets: | |||||
* (glob) | |||||
d2ae7f538514 b | |||||
$ hg debugbackupbundle --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 not show debug commands if there are other candidates | Do not show debug commands if there are other candidates | ||||
$ hg debugcomplete d | $ hg debugcomplete d | ||||
diff | diff | ||||
Show debug commands if there are no other candidates | Show debug commands if there are no other candidates | ||||
$ hg debugcomplete debug | $ hg debugcomplete debug | ||||
debugancestor | debugancestor | ||||
debugapplystreamclonebundle | debugapplystreamclonebundle | ||||
debugbackupbundle | |||||
debugbuilddag | debugbuilddag | ||||
debugbundle | debugbundle | ||||
debugcapabilities | debugcapabilities | ||||
debugcheckstate | debugcheckstate | ||||
debugcolor | debugcolor | ||||
debugcommands | debugcommands | ||||
debugcomplete | debugcomplete | ||||
debugconfig | debugconfig | ||||
cat: output, rev, decode, include, exclude, template | cat: output, rev, decode, include, exclude, template | ||||
clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure | clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure | ||||
commit: addremove, close-branch, amend, secret, edit, force-close-branch, interactive, include, exclude, message, logfile, date, user, subrepos | commit: addremove, close-branch, amend, secret, edit, force-close-branch, interactive, include, exclude, message, logfile, date, user, subrepos | ||||
config: untrusted, edit, local, global, template | config: untrusted, edit, local, global, template | ||||
continue: dry-run | continue: dry-run | ||||
copy: forget, after, at-rev, force, include, exclude, dry-run | copy: forget, after, at-rev, force, include, exclude, dry-run | ||||
debugancestor: | debugancestor: | ||||
debugapplystreamclonebundle: | debugapplystreamclonebundle: | ||||
debugbackupbundle: recover, patch, git, limit, no-merges, stat, graph, style, template | |||||
debugbuilddag: mergeable-file, overwritten-file, new-file | debugbuilddag: mergeable-file, overwritten-file, new-file | ||||
debugbundle: all, part-type, spec | debugbundle: all, part-type, spec | ||||
debugcapabilities: | debugcapabilities: | ||||
debugcheckstate: | debugcheckstate: | ||||
debugcolor: style | debugcolor: style | ||||
debugcommands: | debugcommands: | ||||
debugcomplete: options | debugcomplete: options | ||||
debugcreatestreamclonebundle: | debugcreatestreamclonebundle: |
$ hg help debug | $ hg help debug | ||||
debug commands (internal and unsupported): | debug commands (internal and unsupported): | ||||
debugancestor | debugancestor | ||||
find the ancestor revision of two revisions in a given index | find the ancestor revision of two revisions in a given index | ||||
debugapplystreamclonebundle | debugapplystreamclonebundle | ||||
apply a stream clone bundle file | apply a stream clone bundle file | ||||
debugbackupbundle | |||||
lists the changesets available in backup bundles | |||||
debugbuilddag | debugbuilddag | ||||
builds a repo with a given DAG from scratch in the current | builds a repo with a given DAG from scratch in the current | ||||
empty repo | empty repo | ||||
debugbundle lists the contents of a bundle | debugbundle lists the contents of a bundle | ||||
debugcapabilities | debugcapabilities | ||||
lists the capabilities of a remote peer | lists the capabilities of a remote peer | ||||
debugcheckstate | debugcheckstate | ||||
validate the correctness of the current dirstate | validate the correctness of the current dirstate |
Do we really want to support all of these? (FYI, they include --stat, --graph, --style, --patch, and a few more.)