Merge lp:~jelmer/bzr/tweak-revert-help into lp:bzr

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 6514
Proposed branch: lp:~jelmer/bzr/tweak-revert-help
Merge into: lp:bzr
Diff against target: 37 lines (+12/-5)
1 file modified
bzrlib/builtins.py (+12/-5)
To merge this branch: bzr merge lp:~jelmer/bzr/tweak-revert-help
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+99141@code.launchpad.net

Commit message

Tweak the help string for 'bzr revert'.

Description of the change

This tweaks the help text of 'bzr revert' a bit, as discussed on the mailing list.

See https://lists.ubuntu.com/archives/bazaar/2012q1/074630.html

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

Thanks for that.

As discussed on the list, defining the command as "revert files ..." is a bit circular, so perhaps it's better to say something like "set files in the working tree" or something.

 To remove only some changes, without reverting to a prior version, use merge instead.

Perhaps that should be made more clear that revert will normally discard any uncommitted changes.

Rather than 'last committed revision' we should probably say 'working tree basis revision', which is more accurate, and we should probably mention this never changes the basis revision.

Perhaps we should contrast revert to 'update', which carries uncommitted changes, which goes to the branch tip revision by default, and which does change the basis revision.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks for the review and feedback. I've tweaked the description a bit more.

Revision history for this message
Joseph Wakeling (webdrake) wrote :

Have to say that for me at least, "last committed revision" is to me a lot more comprehensible than "working tree basis revision". What's the reason for distinguishing them? "Base revision of the current working tree" may be a more accurate description, but it may be more confusing than it's worth to users.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Mon, Mar 26, 2012 at 10:06:20AM -0000, Joseph Wakeling wrote:
> Have to say that for me at least, "last committed revision" is to me a lot more comprehensible than "working tree basis revision". What's the reason for distinguishing them? "Base revision of the current working tree" may be a more accurate description, but it may be more confusing than it's worth to users.
They *can* be different in some situations.

If I push to a remote branch with a working tree over e.g. sftp, that will only update the branch and leave the working tree alone. This is because working trees can't be accessed over sftp, only locally. In other words, the branch last revision has been changed but the working tree basis revision hasn't.

Cheers,

Jelmer

Revision history for this message
Vincent Ladeuil (vila) :
review: Approve
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/builtins.py'
2--- bzrlib/builtins.py 2012-03-15 02:42:48 +0000
3+++ bzrlib/builtins.py 2012-03-25 13:39:18 +0000
4@@ -4728,21 +4728,28 @@
5
6
7 class cmd_revert(Command):
8- __doc__ = """Revert files to a previous revision.
9+ __doc__ = """\
10+ Set files in the working tree back to the contents of a previous revision.
11
12 Giving a list of files will revert only those files. Otherwise, all files
13 will be reverted. If the revision is not specified with '--revision', the
14- last committed revision is used.
15+ working tree basis revision is used. A revert operation affects only the
16+ working tree, not any revision history like the branch and repository or
17+ the working tree basis revision.
18
19 To remove only some changes, without reverting to a prior version, use
20 merge instead. For example, "merge . -r -2..-3" (don't forget the ".")
21 will remove the changes introduced by the second last commit (-2), without
22 affecting the changes introduced by the last commit (-1). To remove
23 certain changes on a hunk-by-hunk basis, see the shelve command.
24+ To update the branch to a specific revision or the latest revision and
25+ update the working tree accordingly while preserving local changes, see the
26+ update command.
27
28- By default, any files that have been manually changed will be backed up
29- first. (Files changed only by merge are not backed up.) Backup files have
30- '.~#~' appended to their name, where # is a number.
31+ Uncommitted changes to files that are reverted will be discarded.
32+ Howver, by default, any files that have been manually changed will be
33+ backed up first. (Files changed only by merge are not backed up.) Backup
34+ files have '.~#~' appended to their name, where # is a number.
35
36 When you provide files, you can use their current pathname or the pathname
37 from the target revision. So you can use revert to "undelete" a file by