Skip to content

Commit

Permalink
VCS 0.4.0
Browse files Browse the repository at this point in the history
- Synced all changes from rhodecode into VCS
- Subprocess calls are now made via subprocessio
  provides non-blocking subprocess commands
- Added children methods to changeset objects
- Unified diff between git and mercurial.
  it now shows renames/copies/binary files properly
- Fixed some relative imports in tests
- Implemented __eq__ operator for repositories
- Author and committer are now two separate functions
  allowing to fetch that information from git
- Slicing of repos use now more efficient generator wrappers
  called CollectionGenerator
- Removed LazyProperty from _repo object in dulwich that was causing
  various errors in multithreaded env
- Improved performance of file history methods
- Implemented URL validator for GIT
- Fixed fetch method for GIT to actually fetch all heads

--HG--
extra : amend_source : 1ee7550a83ef18e232683fe73bfe9ab8b8c62511
extra : histedit_source : a61eb96e86483f39541aa83f777cdffd0dd77a64%2Cb7084d92169ae2b6b6c45175000a6e662850a652
  • Loading branch information
marcinkuzminski committed Apr 26, 2013
1 parent 2b8ef89 commit 8dbf597
Show file tree
Hide file tree
Showing 57 changed files with 1,657 additions and 500 deletions.
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ You may also build documentation for yourself - go into ``docs/`` and run::
.. _Sphinx: http://sphinx.pocoo.org/
.. _mercurial: http://mercurial.selenic.com/
.. _git: http://git-scm.com/

2 changes: 0 additions & 2 deletions docs/alternatives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ There are a couple of alternatives to vcs:
If you know any other similar Python library, please let us know!

.. _pida: http://pida.co.uk/


5 changes: 2 additions & 3 deletions docs/api/backends/git.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ GitChangeset

Returns list of added ``FileNode`` objects.

.. autoattribute:: changed
.. autoattribute:: changed

Returns list of changed ``FileNode`` objects.

.. autoattribute:: removed
.. autoattribute:: removed

Returns list of removed ``RemovedFileNode`` objects.

Expand All @@ -65,4 +65,3 @@ GitInMemoryChangeset
:inherited-members:
:undoc-members:
:show-inheritance:

5 changes: 2 additions & 3 deletions docs/api/backends/hg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ MercurialChangeset

Returns list of added ``FileNode`` objects.

.. autoattribute:: changed
.. autoattribute:: changed

Returns list of changed ``FileNode`` objects.

.. autoattribute:: removed
.. autoattribute:: removed

Returns list of removed ``RemovedFileNode`` objects.

Expand All @@ -65,4 +65,3 @@ MercurialInMemoryChangeset
:inherited-members:
:undoc-members:
:show-inheritance:

1 change: 0 additions & 1 deletion docs/api/backends/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ Base Backend

.. automodule:: vcs.backends.base
:members:

1 change: 0 additions & 1 deletion docs/api/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ vcs.cli.SingleChangesetCommand

.. autoclass:: vcs.cli.SingleChangesetCommand
:members:

1 change: 0 additions & 1 deletion docs/api/conf.settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ specified by user. By default it would be ``$HOME/.vimrc``.

This value may be modified by setting system environment ``VCSRC_PATH``
(accessible at ``os.environ['VCSRC_PATH']``).

1 change: 0 additions & 1 deletion docs/api/nodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ RootNode

.. autoclass:: vcs.nodes.RootNode
:members:

1 change: 0 additions & 1 deletion docs/api/utils/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ Lazy attributes utils

.. automodule:: vcs.utils.lazy
:members:

4 changes: 0 additions & 4 deletions docs/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,3 @@ intend to write new backend)!


.. _TDD: http://en.wikipedia.org/wiki/Test-driven_development




3 changes: 1 addition & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Welcome to vcs's documentation!
===============================

``vcs`` is abstraction layer over various version control systems. It is
designed as feature-rich Python_ library with clear :ref:`API`.
designed as feature-rich Python_ library with clear :ref:`API`.

vcs uses `Semantic Versioning <http://semver.org/>`_

Expand Down Expand Up @@ -46,4 +46,3 @@ Other topics
.. _mercurial: http://mercurial.selenic.com/
.. _subversion: http://subversion.tigris.org/
.. _git: http://git-scm.com/

1 change: 0 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ Here is a full list of packages needed to run test suite:
.. _git: http://git-scm.com
.. _dulwich: http://pypi.python.org/pypi/dulwich
.. _mercurial: http://mercurial.selenic.com/

7 changes: 3 additions & 4 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Let's ask repo about the content...
>>> <GitChangeset at 0:c1214f7e79e0>
>>> <GitChangeset at 1:38b5fe81f109>
>>> ...
Walking
-------
Expand Down Expand Up @@ -120,7 +120,7 @@ Now let's ask for nodes at revision faebbb751cc36c137127c50f57bcdb5f1c540013
"""
vcs.backends
~~~~~~~~~~~~
Getting meta data
-----------------
Expand All @@ -131,7 +131,7 @@ Tags and branches
~~~~~~~~~~~~~~~~~
.. code-block:: python
>>> print repo.branches
OrderedDict([('master', 'fe568b4081755c12abf6ba673ba777fc02a415f3')])
>>> for tag, raw_id in repo.tags.items():
Expand Down Expand Up @@ -290,4 +290,3 @@ and we create a html file using `difflib`_.
Now open file at ``/tmp/out.html`` in your favorite browser.
.. _difflib: http://docs.python.org/library/difflib.html
52 changes: 26 additions & 26 deletions docs/theme/ADC/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
{%- block header %}{% endblock %}
{%- block relbar1 %}
<div id="docstitle">
<p>{{docstitle}}</p>
<p>{{docstitle}}</p>
</div>
<div id="header">
<div id="title"><h1>{{ title|striptags }}</h1></div>
<ul id="headerButtons">
<li id="toc_button"><div class="headerButton"><a href="#">Table of Contents</a></div></li>
<li id="page_buttons">
{%- for rellink in rellinks %}
<div class="headerButton"><a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}" {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a></div>
{%- endfor %}
</li>
</ul>
<div id="title"><h1>{{ title|striptags }}</h1></div>
<ul id="headerButtons">
<li id="toc_button"><div class="headerButton"><a href="#">Table of Contents</a></div></li>
<li id="page_buttons">
{%- for rellink in rellinks %}
<div class="headerButton"><a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}" {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a></div>
{%- endfor %}
</li>
</ul>
</div>
{% endblock %}

Expand All @@ -61,8 +61,8 @@
{%- endif %}
{%- endblock %}
{%- block sidebartoc %}
<ul><li class="toctree-l1"><a href="{{ pathto(master_doc) }}">{{ _('Main Page') }}</a></li></ul>
{{ toctree() }}
<ul><li class="toctree-l1"><a href="{{ pathto(master_doc) }}">{{ _('Main Page') }}</a></li></ul>
{{ toctree() }}
{%- endblock %}
{%- block sidebarrel %}
{%- endblock %}
Expand All @@ -83,11 +83,11 @@ <h3>{{ _('This Page') }}</h3>
<div id="searchbox" style="display: none">
{# <h3>{{ _('Quick search') }}</h3> #}
<form class="search" action="{{ pathto('search') }}" method="get">
<div class="search-wrapper">
<span class="search-left"></span>
<input class="prettysearch" type="text" name="q" size="18" />
<span class="search-right">&nbsp;</span>
</div>
<div class="search-wrapper">
<span class="search-left"></span>
<input class="prettysearch" type="text" name="q" size="18" />
<span class="search-right">&nbsp;</span>
</div>
<input type="submit" value="{{ _('Search') }}" class="searchbutton" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
Expand Down Expand Up @@ -128,18 +128,18 @@ <h3>{{ _('This Page') }}</h3>
{%- if show_sphinx %}
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
{%- endif %}
</p>
</p>
</div>
{%- endblock %}
{%- block sidebar2 %}{% endblock %}
{%- block relbar2 %}{% endblock %}
{%- block footer %}
<div id="breadcrumbs">
{%- for parent in parents %}
<a href="{{ parent.link|e }}" {{ accesskey("U") }}>{{ parent.title|safe }}</a><img src="{{ pathto('_static/triangle_closed.png', 1) }}" height="9" width="9" alt="&gt;">
{%- endfor %}
{{ title|safe|e }}
</ul>
</div>
<script type="text/javascript" charset="utf-8" src="{{ pathto('_static/toc.js', 1) }}"></script>
<div id="breadcrumbs">
{%- for parent in parents %}
<a href="{{ parent.link|e }}" {{ accesskey("U") }}>{{ parent.title|safe }}</a><img src="{{ pathto('_static/triangle_closed.png', 1) }}" height="9" width="9" alt="&gt;">
{%- endfor %}
{{ title|safe|e }}
</ul>
</div>
<script type="text/javascript" charset="utf-8" src="{{ pathto('_static/toc.js', 1) }}"></script>
{%- endblock %}

6 comments on commit 8dbf597

@marcinkuzminski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukaszb check it out (i know it's a lot) but if you're ok let's tag it an release !

@lukaszb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, great commit. I would definitely prefer it to be splited into smaller changes but hell, a lot of bugs are fixed!

Here are my notes, let me know what you think about them. Some of them are just notes so I remember what to do before release.

  1. Why do we need get_file_history_2? I would prefer to stick with one.
  2. We should use enumerate(iterable, 1) where applicable (ie. for line numbers)
  3. get_file_annotate should change order of returned objects (sha should be first in my view)
  4. We should probably create something like LazyChangeset (instead of lambda) - this is better for prototyping (seeing lambda objects doesn't tell much to the user)
  5. Why we changed %r to %s in many places for exception string formatting? I always preferred to get raw representation in exceptions as it often point to type of the object being formatted.
  6. No for short variable names!
a, m, d = self._changes_cache
return list(a.union(m).union(d))

Also, why not a | m | d?
7. At hg.changeset (get_file_changeset method):

for cs in reversed([x for x in fctx.filelog()]):

we should probably use generator here instead of a list. Or simply reversed(fctx.filelog()) I guess.
8. Am not fun of something like:

revs = reversed(revisions[start_pos:end_pos]) if reverse else \
    revisions[start_pos:end_pos]

would prefer

revs = revisions[start_pos:end_pos]
if reverse:
    revs = reversed(revs)

A. Isn't Condition unnecessary imported at vcs.utils.compat (it's almost immediately overridden)?
B. itertools are not used at vcs.utils.diffs.
C. Some refactors around imports are not clear to me (ie. why import string ... string.Template( and not from string import Template ... Template( ?
D. Whitespace
E. Tox is still broken (seems it doesn't use test_require values.

@marcinkuzminski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re1 - it's a pure python version of get_file_history, it's really slow but it works when there's no git executable, i can remove it ?
re2 - doesn't work for python2.5

@marcinkuzminski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for nice feedback.

re3 - yes that would be better, i'll change that
re4 - +1 for that
re5 - that was due to some refactoring in rhodecode, but i agree with you better is to use %r, i'll revert that based on that commit
re6 - ok i changed to longer names, but a.union(m).union(d) looks cleaner for me [personal opinion :)]
re7 - need to read some more code to be able to answer that
re8 - yep that looks nicer, it's now changed

A: fixed
B: fixed
C: i always prefer to import modules, like you import os, and use os.path.join
if i import Template from string, looking at the code not always tells you where the Template is from, is it internal class or ?

D: ? don't get it
E: fixed

@lukaszb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Have created Create LazyChangeset #105 for that
  2. That's not so important, we can do that when it starts being frustrating.
  3. Thanks! Basically I prefer using logical sum operator however here it is better with union methods (as it semi-clearly tells that objects are sets)
  4. Well, everything is in that line actually :) filectx() seems to be iterable and reversed consumes iterables ;-)
    C. I see the point, wanted to hear the reasoning. I try to do that when it makes sense, here it absolutely od.
    D. I needed to pass ?w= to the url to read the changes :P (there a lot of whitespace left at the end of lines).

Thanks for all the fixes! Tox for Python 2.5 is still failing, though. Once that is fixed we can perform a release!

@marcinkuzminski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odd travis reported build fine for py2.5

Please sign in to comment.