ActionEnabling » History » Version 7
Version 6 (Chris Cannam, 2010-11-24 09:17 PM) → Version 7/8 (Chris Cannam, 2010-11-25 05:53 PM)
h1. When actions should be enabled
h2. Simple cases
* *Open* - always
Apart from Open, everything depends in the first instance on having a valid local work path -- this will be assumed below.
* *Refresh* - always
* *Preview* - whenever a remote URL is set
* *Pull* - whenever a remote URL is set
* *Push* - whenever a remote URL is set
h2. More complicated things
* *Revert* - whenever a file has been modified, added, or removed since commit
* *Commit* - whenever a file has been modified, added, or removed since commit
Some of the remaining functions look like they should behave differently depending on whether the Work tab or History tab is active. However, I think that's probably confusing -- they should behave the same regardless of which tab is selected; that behaviour should be the "most obvious" behaviour where possible; and they should notify you quite clearly of what you are about to do in a confirmation dialog (which should be the same dialog as asks for your commit message, if appropriate).
Generally speaking, when I've characterised in the past behaviour as varying by tab, that's because I've been imagining having a separate selection in both tabs. But I think that's wrong -- there should be no selection in the History tab. If you want to use a specific changeset in a function, there should be a right-button menu for that. There are no "beginner" functions that need a specific changeset, only "expert" ones.
* *Add* - when at least one untracked file is selected, and no other files are
* *Remove* - when at least one tracked file is selected, and no untracked files are
N.B. the latter implies we need to be able to show unmodified, tracked files.
* *Update* - in principle, should be active only when current branch has something to update to. In practice that may be too complicated, so probably just make it active always.
* *Merge* - only when the current branch has more than one head? otherwise, use context menu in History tab
Review this.
h3. Diff
* *No changes since commit* - inactive
* *No modified files selected* - show diff for folder against parent
* *Modified files selected* - show diff for files against parent
h2. Functions currently missing entirely
* *Create branch*
* *Tag*
* *Rename*
h2. How to determine some things
h3. Whether a default merge makes sense:
@hg heads `hg branch`@
and see whether (a) exactly two heads are returned and (b) the current revision is one of them.
h3. Whether a no-args update would do anything:
@hg heads `hg branch`@
and see whether the current parent revision is _not_ among the returned heads. (what if more than one parent?)
h2. Simple cases
* *Open* - always
Apart from Open, everything depends in the first instance on having a valid local work path -- this will be assumed below.
* *Refresh* - always
* *Preview* - whenever a remote URL is set
* *Pull* - whenever a remote URL is set
* *Push* - whenever a remote URL is set
h2. More complicated things
* *Revert* - whenever a file has been modified, added, or removed since commit
* *Commit* - whenever a file has been modified, added, or removed since commit
Some of the remaining functions look like they should behave differently depending on whether the Work tab or History tab is active. However, I think that's probably confusing -- they should behave the same regardless of which tab is selected; that behaviour should be the "most obvious" behaviour where possible; and they should notify you quite clearly of what you are about to do in a confirmation dialog (which should be the same dialog as asks for your commit message, if appropriate).
Generally speaking, when I've characterised in the past behaviour as varying by tab, that's because I've been imagining having a separate selection in both tabs. But I think that's wrong -- there should be no selection in the History tab. If you want to use a specific changeset in a function, there should be a right-button menu for that. There are no "beginner" functions that need a specific changeset, only "expert" ones.
* *Add* - when at least one untracked file is selected, and no other files are
* *Remove* - when at least one tracked file is selected, and no untracked files are
N.B. the latter implies we need to be able to show unmodified, tracked files.
* *Update* - in principle, should be active only when current branch has something to update to. In practice that may be too complicated, so probably just make it active always.
* *Merge* - only when the current branch has more than one head? otherwise, use context menu in History tab
Review this.
h3. Diff
* *No changes since commit* - inactive
* *No modified files selected* - show diff for folder against parent
* *Modified files selected* - show diff for files against parent
h2. Functions currently missing entirely
* *Create branch*
* *Tag*
* *Rename*
h2. How to determine some things
h3. Whether a default merge makes sense:
@hg heads `hg branch`@
and see whether (a) exactly two heads are returned and (b) the current revision is one of them.
h3. Whether a no-args update would do anything:
@hg heads `hg branch`@
and see whether the current parent revision is _not_ among the returned heads. (what if more than one parent?)