Commits on Aug 23, 2010
  1. Rename _faster.so to _helpers.so.

    Okay, _faster.so wasn't a good choice of names.  Partly because not
    everything in there is just to make stuff faster, and partly because some
    *proposed* changes to it don't just make stuff faster.  So let's rename it
    one more time.  Hopefully the last time for a while!
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Aug 22, 2010
Commits on Aug 22, 2010
  1. @lelutin

    lib/bup/ssh: Add docstrings

    Document the code with doctrings.
    
    Also add an "import sys" line since it is used by sys.argv[0] on line 6.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Aug 15, 2010
  2. @lelutin

    lib/bup/options: Add docstrings

    Document the code with docstrings.
    
    Use one line per imported module as recommended by PEP 8 to make it
    easier to spot unused modules.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Aug 15, 2010
  3. @lelutin

    import cleanup

    Remove unused imported modules.
    
    I started using the pyflakes.vim plugin and it automagically shows a
    bunch of problems/uncleanliness in the code. It helped me pull this out
    in 15mins.
    
    This change shouldn't have any impact on performance or functionality
    but it makes the code cleaner.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Aug 15, 2010
  4. cmd/ftp: don't die if we can't import the ctypes module.

    It's only needed on some rare broken versions of readline anyway.  If we
    can't find the module, chances are the system doesn't have that broken
    version of readline.
    
    Based on suggestions by Gabriel Filion and Aaron Ucko.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Aug 21, 2010
  5. @lelutin

    lib/bup/vfs: bring back Python 2.4 support

    There is currently one test failure when running tests against Python
    2.4: a try..except..finally block that's interpreted as a syntax error.
    The commit introducing this incompatibility with 2.4 is f77a082
    
    This is a well known python 2.4 limitation and the workaround, although
    ugly, is easy.
    
    With this test passing, Python 2.4 support is back.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Aug 20, 2010
Commits on Aug 11, 2010
  1. @lelutin

    lib/bup/vfs: Add docstrings

    Since the vfs module uses the function git._treeparse, it should not be
    named as if it was a private function. Rename git._treeparse to
    git.treeparse and document it (add a docstring to it).
    
    Also, transform _ChunkReader, _FileReader and Node into new-style
    classes.
    
    Finally, remove trailing spaces from lib/bup/vfs.py .
    lelutin committed with Aug 2, 2010
Commits on Aug 2, 2010
  1. DESIGN: update mentions of stupidsum to reflect new rollsum algorithm.

    Pointed out by Gabriel Filion.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Aug 1, 2010
  2. README: typo.

    Noticed by Zoran Zaric.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Aug 1, 2010
Commits on Jul 31, 2010
  1. cmd/save: update the progress meter less often.

    If you ran 'bup save' in an ssh sessio, you could end up sending huge
    amounts of data back over ssh *just* to update the progress meter after
    every single block!  Oops.  Limit the updates to only about 5 per second,
    which is much better.
    committed Jul 31, 2010
  2. Rename _hashsplit.so to _faster.so, and move bupsplit into its own so…

    …urce file.
    
    A lot of stuff in _hashsplit.c wasn't actually about hashsplitting; it was
    just a catch-all for all our C accelerator functions.  Now the module name
    reflects that.
    
    Also move the bupsplit functions into their own non-python-dependent C
    source file so they can be used as part of other projects.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 30, 2010
  3. test.sh: check the return code of 'bup random'

    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 30, 2010
Commits on Jul 28, 2010
  1. options.py: support for putting default values in [square brackets].

    This looks good in the usage message, and is a better place to hardcode such
    things than in the code itself.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 16, 2010
  2. _hashsplit.c: get rid of some warnings indicated by a C++ compiler.

    Not hugely important, but might as well fix them.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 27, 2010
  3. _hashsplit.c: replace the stupidsum algorithm with rsync's adler32-ba…

    …sed one.
    
    I've been meaning to do this for a while, but a particular test dataset that
    really caused problems with stupidsum() (ie. it split things into way more
    chunks than it should have) finally screwed me over.  Let's change over to a
    "real" checksum algorithm.
    
    Non-annoying datasets shouldn't be noticeably affected, but bad ones (such
    as my test case from EQL Data) can be 10x more sensible.  Typical backup
    sets now have about 20% fewer chunks, although this has little affect on the
    overall repository size.
    
    WARNING: After this patch, all your chunk boundaries will be different from
    before!  That means your incremental backups won't be terribly incremental
    and your backup repositories will jump in size.  This should only happen
    once.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 27, 2010
  4. _hashsplit.c: switch rollsum_roll() to a macro instead of an inline f…

    …unction.
    
    gcc 4.3's optimizer manages to fail at optimizing the inline, but works okay
    with the macro.
    
    Mysteriously, if find_ofs() is *not* static (and therefore presumably
    *harder* to optimize), the optimizer works either way.  But removing the
    static is just wrong, so use the macro instead.
    
    The difference in speed is about 53 megs/sec vs 80 megs/sec on my machine
    for this command:
    
    	bup random 100M 2>/dev/null | bup split -N --bench
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 27, 2010
  5. _hashsplit.c: refactor a bit, and add a self-test.

    In preparation for replacing the stupidsum algorithm with the rsync
    adler32-based one.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 27, 2010
  6. make clean: remove some leftover files.

    Stuff has moved around a bit recently, and we weren't cleaning up everything
    like we should.
    committed Jul 28, 2010
Commits on Jul 27, 2010
  1. @lelutin

    cmd/web: hide .dotfiles by default

    Make all files begining with a dot be hidden by default. The hidden
    files can be shown by giving the argument "hidden" with a vlue of 1 in
    the URL.
    
    Also, in _compute_dir_contents, remove the line "contents = []" since it
    is never used.
    
    Finally add a "Show/Hide hidden files" link on the pages where content
    is hidden.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Jul 27, 2010
  2. @lelutin

    cmd/ftp: exit cleanly on Ctrl-C

    bup ftp currently does not handle KeyboardInterrupt exceptions.
    
    Simply call handle_ctrl_c() at the beginning of the file to make the
    command exit without a stacktrace.
    lelutin committed with Jul 27, 2010
  3. @lelutin

    cmd/ftp: Hide .dotfiles by default (-a shows them)

    Normally in FTP sites, files beginning with a dot are hidden from a list
    (ls) command by default. Also, using the argument '-a' makes the list
    show hidden files.
    
    The current 'bup ftp' implementation does not behave so. Make it hide
    hidden files by default, as expected, and show hidden files when '-a' or
    '--all' is specified to the 'ls' command.
    
    All unknown switches will make bup ftp show the ls command usage.
    
    Users can also give 'ls --help' to obtain the usage string.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Jul 26, 2010
  4. @lelutin

    lib/options: Add an onabort argument to Options()

    Some times, we may want to parse a list of arguments and not have the
    call to Options.parse() exit the program when it finds an unknown
    argument.
    
    Add an argument to the class' __init__ method that can be either a
    function or a class (must be an exception class). If calling the
    function or class constructor returns an object, this object will be
    raised on abort.
    
    Also add a convenience exception class named Fatal that can be
    passed to Options() to exclusively catch situations in which
    Options.parse() would have caused the program to exit.
    
    Finally, set the default value to the onabort argument to call
    sys.exit(97) as was previously the case.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Jul 26, 2010
  5. @lelutin

    cmd/ftp: if completion fails due to FileNotFound, just eat it.

    Just as bash would do, if you're trying to complete a filename that doesn't
    exist, just don't offer any completions.  In this case, it only happens if
    you try to complete through a broken symlink.
    
    Now that we've fixed this case, enable the printing of exception tracebacks
    in case of *other* kinds of completion errors, since we don't expect there
    to be any.
    
    [Committed by apenwarr based on an unofficial patch from Gabriel]
    lelutin committed with Jul 27, 2010
Commits on Jul 26, 2010
  1. @rlbdv

    Add a mode argument to mkdirp.

    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with Jul 25, 2010
  2. @rlbdv

    Don't specify a user or group during "make install".

    This makes it possible to install bup as a normal user.
    
    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with Jul 25, 2010
  3. @rlbdv

    Remove Makefile lines that only contain a tab.

    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with Jul 25, 2010
  4. cmd/ftp: don't let people cd into a non-directory.

    This bug was relatively harmless (since you could also cd back out again)
    but kind of weird.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 26, 2010
  5. vfs: resolve absolute symlinks inside their particular backup set.

    Let's say you back up a file "/etc/motd" that's a symlink to
    "/var/run/motd".  The file inside the backup repo is actually
    /whatever/latest/etc/motd, so the symlink should *actually* point to
    /whatever/latest/var/run/motd.  Let's resolve it that way automatically in
    Symlink.dereference().
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 26, 2010
  6. vfs: try_lresolve() was a bad idea. Create try_resolve() instead.

    Also add some comments to describe the actual differences between resolve()
    and lresolve(), and clean things up a bit so that they actually work as
    they're supposed to.
    
    Basically, all of lresolve(), resolve(), and try_resolve() depend on
    *intermediate* paths being resolvable; all of them will throw an exception
    if not.  They only differ in the very last node in the path, when that node
    is a symlink:
    
      resolve() will dereference it or throw an exception if it can't;
      try_resolve() will try to dereference it, but return self if it can't;
      lresolve() will not dereference it at all, like lstat() doesn't.
    
    With that in mind, we can fix up cmd/ftp and cmd/web to use the right calls,
    thus fixing an unexpected error in ftp's tab completion reported by Gabriel
    Filion, which would happen if you tried to tab complete inside a directory
    that contained a broken symlink.  We only care what the symlink points to so
    we can decide whether or not to append '/' to the tab completion, so we want
    it to fail silently if it's going to fail.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 26, 2010
  7. @lelutin

    fix helpers.columnate bug when list is empty

    When the list given to the columnate function is empty, the function
    raises an exception when determining the max(len of all elements), since
    the list given to max is empty.
    
    One indirect example of when this bug is apparent is in the 'bup ftp'
    command when listing an empty directory:
    
        bup> ls backupname/latest/etc/keys
        error: max() arg is an empty sequence
    
    Add a special condition at the beginning of the columnate function that
    returns an empty string if the list of elements is empty.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Jul 25, 2010
Commits on Jul 23, 2010
  1. @pmccurdy

    Ignore vim's .sw? files.

    Vim names its temp files .filename.sw?.  Let's ignore them.
    
    Signed-off-by: Peter McCurdy <petermccurdy@alumni.uwaterloo.ca>
    pmccurdy committed with Jul 23, 2010
  2. cmd/web: don't die if lresolve() fails.

    Some symlinks end up pointing to nonexistent names, which is maybe not
    "normal", but certainly is allowed.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Jul 23, 2010
  3. @jbeda

    Convert 'bup web' directory listing to use tornado templates.

    This includes creating a new idea of a "resource path" that currently sits
    under the lib dir. Getting resources is supported with a new helper
    (resource_path).
    
    Signed-off-by: Joe Beda <joe@bedafamily.com>
    jbeda committed with Jul 23, 2010
Commits on Jul 22, 2010
  1. @jbeda

    Default 'bup web' to serving on localhost only.

    Also make command output match man page.
    
    Signed-off-by: Joe Beda <joe@bedafamily.com>
    jbeda committed with Jul 22, 2010