mozilla

Revision 137665 of Mercurial/Desired Features

  • Revision slug: Mercurial//Desired_Features
  • Revision title: Mercurial/Desired Features
  • Revision id: 137665
  • Created:
  • Creator: BenjaminSmedberg
  • Is current revision? No
  • Comment graphical history
Tags: 

Revision Content

Improvements to the Mercurial Client

CVS-like atomic commit+push

For users who wish to use mercurial like CVS, we want an atomic commit+push routine:

hg servercommit [remote-repo]

Performs the following actions:

  • Check that the local repository has no incoming changes from the remote repository... if it does, prompt the user to <tt>hg pull -u</tt>
  • editor pops up for commit message
  • If commit message was edited, do the commit
  • Push the commit to the server.
  • If the push fails because it would add a remote head, there was an intermediate commit by another user. Strip the commit from the local repository and restore the working directory to its original (locally modified) state

CVS-like behavior mode

Write an extension or tool that disables all mercurial commands that wouldn't operate in CVS-like mode. So disable at least:

  • commit
  • pull without -u
  • unbundle
  • import
  • backout

Improve the hgweb viewer

Add HTML anchors to many elements

Provide named anchors for various elements so that users may post links to them in bug reports, etc.

  • line numbers in "file" and "annotate" view
  • files and hunks in "revision" view, e.g. link to a particular hunk of http://hg.mozilla.org/mozilla-central/?rev/1b97a74034d1

Allow marking lines of "file" and "annotate" view

In bonsai, you can use a magic &mark=line-line,line-line URL parameter to mark interesting lines, e.g.: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/tools/tinderbox-configs/firefox/win32/mozconfig&rev=1.1.2.2&mark=8-12

  1. Reimplement the mark parameter in hg "file" and "annotate" view
  2. Add marking UI so that users can create a marked-up URI without hand-editing the URI

Add basic searching

From the root view or revision view of the hg viewer, give the ability for users to type "cssframeconstructor" and find nsCSSFrameConstructor.h/cpp in the default revision (root view) or the current revision (revision view).

Add graphical history viewing

Add the ability to get a graphical changelog of a particular file, and perhaps of the entire repository, similar to the bonsai functionality.

Because complete history is so large, it may make sense for this to be a dynamically-expandable view, using SVG, instead of a generated image.

This is somewhat like a web version of <tt>hg glog</tt> or <tt>hg view</tt>.

Feature: linear history according to a particular repository

Because mercurial history can get very branch-y, we would like the ability to navigate through history linearly as it appears in a particular repository:

Step 1: mozilla-central

Image:step1.png

Step 2: local user clones m-c and adds commits

Image:Step2.png

Step 3: new revisions in m-c

Image:Step3.png

Step 4: user merges

Image:Step4.png

Step 5: user pushes

Image:Step5.png

So, the linear history of mozilla-central (the mainline) should be recorded somehow as A -> B -> E -> F. However, we should not require this information to be known at commit-time. It should be recorded when a changeset is pushed to mozilla-central.

Doing this should not impose special requirements on users: they should not have to create a special named branch for their intermediate changes, nor should they have to follow special rules about which direction a particular merge happens.

Possible implementation may include some kind of named-branch, or a datastore recording in which direction merges should be followed.

This implementation should work for multiple ancestries: e.g. a user should be able to follow either mozilla-central or actionmonkey history if they wish.

Client-side requirements

Add the ability to diff an arbitrary revision against it's last ancestor in mozilla-central. So after step 4, the user should be able to do something like:

hg diff -rF --ancestor=mozilla-central

Add the ability for <tt>annotate</tt> and <tt>log</tt> to follow the history of mozilla-central:

$ hg log --follow=mozilla-central
changeset: F
changeset: E
changeset: B
changeset: A

Server requirements

none in particular, though I presume this will involve a post-push hook

hgweb requirements

The web interface for mozilla-central should annotate/log the mozilla-central history by default, and only note branch histories when explicitly requested by the user.

Revision Source

<h3 name="Improvements_to_the_Mercurial_Client"> Improvements to the Mercurial Client </h3>
<h4 name="CVS-like_atomic_commit.2Bpush"> CVS-like atomic commit+push </h4>
<p>For users who wish to use mercurial like CVS, we want an atomic commit+push routine:
</p>
<pre class="eval">hg servercommit [remote-repo]
</pre>
<p>Performs the following actions:
</p>
<ul><li> Check that the local repository has no incoming changes from the remote repository... if it does, prompt the user to <tt>hg pull -u</tt>
</li><li> editor pops up for commit message
</li><li> If commit message was edited, do the commit
</li><li> Push the commit to the server.
</li><li> If the push fails because it would add a remote head, there was an intermediate commit by another user. Strip the commit from the local repository and restore the working directory to its original (locally modified) state
</li></ul>
<h4 name="CVS-like_behavior_mode"> CVS-like behavior mode </h4>
<p>Write an extension or tool that disables all mercurial commands that wouldn't operate in CVS-like mode. So disable at least:
</p>
<ul><li> commit
</li><li> pull without -u
</li><li> unbundle
</li><li> import
</li><li> backout
</li></ul>
<h3 name="Improve_the_hgweb_viewer"> Improve the hgweb viewer </h3>
<h4 name="Add_HTML_anchors_to_many_elements"> Add HTML anchors to many elements </h4>
<p>Provide named anchors for various elements so that users may post links to them in bug reports, etc.
</p>
<ul><li> line numbers in "file" and "annotate" view
</li><li> files and hunks in "revision" view, e.g. link to a particular hunk of http://hg.mozilla.org/mozilla-central/?rev/1b97a74034d1
</li></ul>
<h4 name="Allow_marking_lines_of_.22file.22_and_.22annotate.22_view"> Allow marking lines of "file" and "annotate" view </h4>
<p>In bonsai, you can use a magic &amp;mark=line-line,line-line URL parameter to mark interesting lines, e.g.:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/tools/tinderbox-configs/firefox/win32/mozconfig&amp;rev=1.1.2.2&amp;mark=8-12
</p>
<ol><li> Reimplement the mark parameter in hg "file" and "annotate" view
</li><li> Add marking UI so that users can create a marked-up URI without hand-editing the URI
</li></ol>
<h4 name="Add_basic_searching"> Add basic searching </h4>
<p>From the <a class="external" href="http://hg.mozilla.org/mozilla-central/">root view</a> or <a class="external" href="http://hg.mozilla.org/mozilla-central/?rev/1b97a74034d1">revision view</a> of the hg viewer, give the ability for users to type "cssframeconstructor" and find nsCSSFrameConstructor.h/cpp in the default revision (root view) or the current revision (revision view).
</p>
<h4 name="Add_graphical_history_viewing"> Add graphical history viewing </h4>
<p>Add the ability to get a graphical changelog of a particular file, and perhaps of the entire repository, similar to the <a class="external" href="http://bonsai.mozilla.org/cvsgraph.cgi?file=/mozilla/tools/tinderbox-configs/firefox/win32/mozconfig">bonsai functionality</a>.
</p><p>Because complete history is so large, it may make sense for this to be a dynamically-expandable view, using SVG, instead of a generated image.
</p><p>This is somewhat like a web version of <tt>hg glog</tt> or <tt>hg view</tt>.
</p>
<h3 name="Feature:_linear_history_according_to_a_particular_repository"> Feature: linear history according to a particular repository </h3>
<p>Because mercurial history can get very branch-y, we would like the ability to navigate through history linearly as it appears in a particular repository:
</p><p>Step 1: mozilla-central
</p><p><img alt="Image:step1.png" src="File:en/Media_Gallery/Step1.png">
</p><p>Step 2: local user clones m-c and adds commits
</p><p><img alt="Image:Step2.png" src="File:en/Media_Gallery/Step2.png">
</p><p>Step 3: new revisions in m-c
</p><p><img alt="Image:Step3.png" src="File:en/Media_Gallery/Step3.png">
</p><p>Step 4: user merges
</p><p><img alt="Image:Step4.png" src="File:en/Media_Gallery/Step4.png">
</p><p>Step 5: user pushes
</p><p><img alt="Image:Step5.png" src="File:en/Media_Gallery/Step5.png">
</p><p>So, the linear history of mozilla-central (the mainline) should be recorded somehow as A -&gt; B -&gt; E -&gt; F. However, we should not require this information to be known at <i>commit</i>-time. It should be recorded when a changeset is <i>pushed to mozilla-central</i>.
</p><p>Doing this should not impose special requirements on users: they should not have to create a special named branch for their intermediate changes, nor should they have to follow special rules about which direction a particular merge happens.
</p><p>Possible implementation may include some kind of named-branch, or a datastore recording in which direction merges should be followed.
</p><p>This implementation should work for multiple ancestries: e.g. a user should be able to follow either mozilla-central or actionmonkey history if they wish.
</p>
<h4 name="Client-side_requirements"> Client-side requirements </h4>
<p>Add the ability to diff an arbitrary revision against it's last ancestor in mozilla-central. So after step 4, the user should be able to do something like:
</p>
<pre class="eval">hg diff -rF --ancestor=mozilla-central
</pre>
<p>Add the ability for <tt>annotate</tt> and <tt>log</tt> to follow the history of mozilla-central:
</p>
<pre class="eval">$ hg log --follow=mozilla-central
changeset: F
changeset: E
changeset: B
changeset: A
</pre>
<h4 name="Server_requirements"> Server requirements </h4>
<p>none in particular, though I presume this will involve a post-push hook
</p>
<h4 name="hgweb_requirements"> hgweb requirements </h4>
<p>The web interface for mozilla-central should annotate/log the mozilla-central history by default, and only note branch histories when explicitly requested by the user.
</p>
Revert to this revision