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
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py 2012-03-15 02:42:48 +0000
+++ bzrlib/builtins.py 2012-03-25 13:39:18 +0000
@@ -4728,21 +4728,28 @@
47284728
47294729
4730class cmd_revert(Command):4730class cmd_revert(Command):
4731 __doc__ = """Revert files to a previous revision.4731 __doc__ = """\
4732 Set files in the working tree back to the contents of a previous revision.
47324733
4733 Giving a list of files will revert only those files. Otherwise, all files4734 Giving a list of files will revert only those files. Otherwise, all files
4734 will be reverted. If the revision is not specified with '--revision', the4735 will be reverted. If the revision is not specified with '--revision', the
4735 last committed revision is used.4736 working tree basis revision is used. A revert operation affects only the
4737 working tree, not any revision history like the branch and repository or
4738 the working tree basis revision.
47364739
4737 To remove only some changes, without reverting to a prior version, use4740 To remove only some changes, without reverting to a prior version, use
4738 merge instead. For example, "merge . -r -2..-3" (don't forget the ".")4741 merge instead. For example, "merge . -r -2..-3" (don't forget the ".")
4739 will remove the changes introduced by the second last commit (-2), without4742 will remove the changes introduced by the second last commit (-2), without
4740 affecting the changes introduced by the last commit (-1). To remove4743 affecting the changes introduced by the last commit (-1). To remove
4741 certain changes on a hunk-by-hunk basis, see the shelve command.4744 certain changes on a hunk-by-hunk basis, see the shelve command.
4745 To update the branch to a specific revision or the latest revision and
4746 update the working tree accordingly while preserving local changes, see the
4747 update command.
47424748
4743 By default, any files that have been manually changed will be backed up4749 Uncommitted changes to files that are reverted will be discarded.
4744 first. (Files changed only by merge are not backed up.) Backup files have4750 Howver, by default, any files that have been manually changed will be
4745 '.~#~' appended to their name, where # is a number.4751 backed up first. (Files changed only by merge are not backed up.) Backup
4752 files have '.~#~' appended to their name, where # is a number.
47464753
4747 When you provide files, you can use their current pathname or the pathname4754 When you provide files, you can use their current pathname or the pathname
4748 from the target revision. So you can use revert to "undelete" a file by4755 from the target revision. So you can use revert to "undelete" a file by