Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Oct 20, 2012
  1. @rlbdv

    Convert BUP_DIR to an absolute path so chdir() won't cause trouble.

    rlbdv authored
    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
Commits on Aug 17, 2012
  1. @lelutin @rlbdv

    Remove useless code in main.py around the -d option

    lelutin authored rlbdv committed
    While debugging another problem with BUP_DIR, I saw a part of the
    code that looked kinda suspicious (not in itself, but in the context of
    the file):
    
      115 subcmd_env = os.environ
      116 if dest_dir:
      117     subcmd_env.update({"BUP_DIR" : dest_dir})
    
    the subcmd_env variable is never used in main.py. However, when I
    removed that part, the -d option stopped working and bup used ~/.bup
    instead: so it _is_ doing what we want it to.
    
    The reason why it's working is that line 115 is actually not creating a
    copy of the dict, but rather simply pointing to the same dict. so the
    call to update() actually changes the environment for the main program,
    which is actually quite alright (e.g. it supercedes the environment
    variable and ensures that the path given to -d is inherited into
    subprocesses)
    
    Now the problem is that this code is very not obvious about what it
    does. Plus, it's a couple of useless lines that we need to maintain.
    Let's just remove any extraneous work and make the addition to the
    environment triggered by the -d option as obvious and concise as
    possible.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    Reviewed-by: Rob Browning <rlb@defaultvalue.org>
  2. @blueyed @rlbdv

    Resolve bup argv[0] symlinks.

    blueyed authored rlbdv committed
    Resolve any symlinks in argv[0] so that the subsequent PYTHONPATH
    adjustment will work properly.
    
    Signed-off-by: Daniel Hahler <git@thequod.de>
    Acked-by: Gabriel Filion <lelutin@gmail.com>
    Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Commits on Feb 20, 2011
  1. options.py: o.fatal(): print error after, not before, usage message.

    authored
    git prints the error *before* the usage message, but the more I play with
    it, the more I'm annoyed by that behaviour.  The usage message can be pretty
    long, and the error gots lost way above the usage message.  The most
    important thing *is* the error, so let's print it last.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Feb 13, 2011
  1. main.py: fix whitespace in the usage string.

    authored
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  2. main.py: use execvp() instead of subprocess.Popen() when possible.

    authored
    This avoids an extra process showing up in the 'ps' listing if we're not
    going to be using bup-newliner anyhow.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Feb 1, 2011
  1. Add DemuxConn and `bup mux` for client-server

    Brandon Low authored committed
    `bup mux` works with any bup command to multiplex its stdout and stderr
    streams over a single stdout stream.
    
    DemuxConn works on the client side to demultiplex stderr and data
    streams from a single stream, emulating a simple connection.
    
    For now, these are only used in the case of simple socket bup://
    client-server connections, because rsh and local connections don't need
    them.
    
    Signed-off-by: Brandon Low <lostlogic@lostlogicx.com>
Commits on Jan 26, 2011
  1. Give main.py the a --profile option

    Brandon Low authored committed
    This is just a convenience for anyone who is interested in seeing where
    CPU seconds are going.
    
    Signed-off-by: Brandon Low <lostlogic@lostlogicx.com>
Commits on Dec 1, 2010
  1. @lelutin

    add a tag command

    lelutin authored committed
    Currently implemented: list all tags, add a tag on a specific commit or
    head, delete a known tag.
    
    Also, make vfs expose a new directory called '/.tag' which contains a
    link for each tag to its associated commit directory situated in
    '/.commit'. Finally, make tags appear as symlinks on branch directories
    on which the tagged commit is visible.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Commits on Sep 8, 2010
  1. cmd/restore: embarrassingly slow implementation of 'bup restore'

    authored
    Well, that was easy, since vfs.py already existed and is doing most of the
    hard work.  Only 103 lines including all the log message handling and
    whatnot.
    
    Only one catch: the restoring code is definitely not optimized.  Among other
    things (like the probably-excessive-for-our-restoring-needs layering in
    vfs.py), we're still calling into 'git cat-file --stdin' to retrieve our
    objects.  This involves lots and lots of context switches, plus it can't use
    midx files for its lookups.  The result is that restoring takes much more
    CPU time and memory than it really should.  But oh well, we have to start
    somewhere.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  2. options.py: get the real tty width for word wrapping purposes.

    authored
    Previously we just assumed it was 70 chars, which was safe enough, but not
    as elegant as actually reading the real value and adjusting the word wrap of
    the usage string accordingly.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Sep 7, 2010
  1. Introduce BUP_DEBUG, --debug, and tone down the log messages a lot.

    authored
    There's a new global bup option, --debug (-D) that increments BUP_DEBUG.  If
    BUP_DEBUG >=1, debug1() prints; if >= 2, debug2() prints.
    
    We change a bunch of formerly-always-printing log() messages to debug1 or
    debug2, so now a typical bup session should be a lot less noisy.
    
    This affects midx in particular, which was *way* too noisy now that 'bup
    save' and 'bup server' were running it automatically every now and then.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  2. client.py,git.py: run 'bup midx -a' automatically sometimes.

    authored
    Now that 'bup midx -a' is smarter, we should run it automatically after
    creating a new index file.  This should remove the need for running it by
    hand.
    
    Thus, we also remove 'bup midx' from the lists of commonly-used subcommands.
    (While we're here, let's take out 'split' and 'join' too; you should be
    using 'index' and 'save' most of the time.)
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Sep 6, 2010
  1. Rename 'bup rbackup' to 'bup on'

    authored
    'rbackup' was a dumb name but I couldn't think of anything better at the
    time.  This works nicely in a grammatical sort of way:
    
       bup on myserver save -n myserver-backup /etc
    
    Now that we've settled on a name, also add some documentation for the
    command.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Jul 23, 2010
  1. @jbeda

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

    jbeda authored committed
    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>
Commits on Jul 12, 2010
  1. @jbeda

    Add new 'bup web' command.

    jbeda authored committed
    'bup web' starts a web server that allows one to browse the bup repository
    from a web browser.
    
    Also reorganized version-cmd to allow easy access to bup version from other
    places.
    
    Signed-off-by: Joe Beda <joe@bedafamily.com>
Commits on Apr 24, 2010
  1. cmd/version, etc: fix version number detection stuff.

    authored
    Gabriel Filion pointed out that bup's version number (which we added to the
    man pages automatically) was not detected when you used a bup tarball
    generated from 'git archive' (or more likely, you let GitHub call 'git
    archive' for you).  That makes sense, since our version detection was based
    on having a .git directory around, which the tarball doesn't.
    
    Instead, let's create a .gitattributes file and have it auto-substitute some
    version information during 'git archive'.  Of course, if we actually *do*
    have a .git directory, continue to use that.
    
    While we're here, add a new 'bup version' command and alias "bup --version"
    and "bup -V" to call it, since those options are pretty standard.
Commits on Apr 23, 2010
  1. cmd/ftp: 'ls' command should print filenames in columns.

    authored
    We use the columnate() function from main.py for this, now moved into
    helpers.py.
Commits on Apr 1, 2010
  1. Add a 'make install' target.

    authored
    Also change main.py to search around in appropriate places for the installed
    library files.  By default, if your bup is in /usr/bin/bup, it'll look in
    /usr/lib/bup.  (It drops two words off the end of the filename and adds
    /lib/bup to the end.)
    
    This also makes the Debian packager at
    	http://git.debian.org/collab-maint/bup
    actually produce a usable package.
Commits on Mar 25, 2010
  1. @rlbdv

    Add support for a global --bup-dir or -d argument.

    rlbdv authored committed
    When a "--bup-dir DIR" or "-d DIR" argument is provided, act as if
    BUP_DIR=DIR is set in the environment.
    
    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
  2. @rlbdv

    Add support for global command-line options (before any subcmd).

    rlbdv authored committed
    Process global arguments via getopt before handling a subcmd, and add
    initial support for a global --help (or -?) option.
    
    Also support --help for subcmds by noticing and translating
    
      git ... subcmd --help ...
    
    into
    
      git ... help subcmd ...
    
    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Commits on Mar 21, 2010
  1. main.py: don't leak a file descriptor.

    authored
    subprocess.Popen() is a little weird about when it closes the file
    descriptors you give it.  In this case, we have to dup() it because if
    stderr=2 (the default) and stdout=2 (because fix_stderr), it'll close fd 2.
    But if we dup it first, it *won't* close the dup, because stdout!=stderr.
    So we have to dup it, but then we have to close it ourselves.
    
    This was apparently harmless (it just resulted in an extra fd#3 getting
    passed around to subprocesses as a clone of fd#2) but it was still wrong.
Commits on Mar 14, 2010
  1. main: even more fixes for signal handling.

    authored
    If the child doesn't die after the first SIGINT and the user presses ctrl-c
    one more time, the main bup process would die instead of forwarding it on to
    the child.  That's no good; we actually have to loop forwarding signals
    until the child is really good and dead.
    
    And if the child refuses to die, well, he's the one with the bug, not
    main.py.  So main.py should stay alive too in the name of not losing track
    of things.
Commits on Mar 13, 2010
  1. Correctly pass along SIGINT to child processes.

    authored
    Ever since we introduced bup newliner, signal handling has been a little
    screwy.  The problem is that ctrl-c is passed to *all* processes in the
    process group, not just the parent, so everybody would start terminating at
    the same time, with very messy results.
    
    Two results were particularly annoying: git.PackWriter()'s destructor
    wouldn't always get called (so half-finished packs would be lost instead of
    kept so we don't need to backup the same stuff next time) and bup-newliner
    would exit, so the stdout/stderr of a process that *did* try to clean up
    would be lost, usually resulting in EPIPE, which killed the proces while
    attempting to clean up.
    
    The fix is simple: when starting a long-running subprocess, give it its own
    session by calling os.setsid().  That way ctrl-c is only sent to the
    toplevel 'bup' process, who can forward it as it should.
    
    Next, fix bup's signal forwarding to actually forward the same signal as it
    received, instead of always using SIGTERM.
Commits on Mar 4, 2010
  1. main: fix problem when redirecting to newliner on MacOS X.

    authored
    It's probably just a bug in python 2.4.2, which is the version on my old
    MacOS machine.  But it seems that if you use subprocess.Popen with stdout=1
    and/or stderr=2, it ends up closing the file descriptors instead of passing
    them along.  Since those are the defaults anyway, just use None instead.
Commits on Mar 3, 2010
  1. main: initialize 'p' before the try/finally that uses it.

    authored
    Otherwise, if we fail to run the subprocess, the finally section doesn't
    work quite right.
  2. 'make stupid' stopped working when I moved subcommands into their own…

    authored
    … dir.
    
    Remote server mode tries to add the directory of argv[0] (the
    currently-running program) to the PATH on the remote server, just in case
    bup isn't installed in the PATH there, so that it can then run 'bup server'.
    
    However, now that bup-save is in a different place than bup, argv[0] is the
    wrong place to look.  Instead, have the bup executable export an environment
    variable containing its location, and client.py can use that instead of
    argv[0].  Slightly gross, but it works.
Commits on Mar 2, 2010
  1. Add man pages for random, newliner, help, memtest, ftp.

    authored
    Also add a 'help' command to ftp, and fix up some minor help messages.
  2. bup random: fix progress output and don't print to a tty.

    authored
    We were printing output using a series of dots, which interacted badly with
    bup newliner (and for good reason).  Change it to actually display the
    number of megabytes done so far.
    
    Also, don't print random binary data to a tty unless -f is given.  It's
    just more polite that way.
  3. main.py: clean up subprocesses dying on signal.

    authored
    CTRL-C didn't abort 'bup random' properly, and possibly others as well.
Commits on Mar 1, 2010
  1. main: list common commands before other ones.

    authored
    When you just type 'bup' or 'bup help', we print a list of available
    commands.  Now we improve this list by:
    
    1) Listing the common commands (with one-line descriptions) before listing
    the automatically-generated list.
    
    2) Printing the automatically-generated list in columns, so it takes up less
    vertical space.
    
    This whole concept was stolen from how git does it.  I think it should be a
    bit more user friendly for beginners this way.
Commits on Feb 28, 2010
  1. Add a 'bup help' command.

    authored
    It works like 'git help xxx', ie. it runs 'man bup-xxx' where xxx is the
    command name.
  2. Move cmd-*.py to cmd/*-cmd.py.

    authored
    The bup-* programs shouldn't need to be installed into /usr/bin; we should
    search for them in /usr/lib somewhere.
    
    I could have left the names as cmd/cmd-*.py, but the cmd-* was annoying me
    because of tab completion.  Now I can type cmd/ran<tab> to get
    random-cmd.py.
  3. Move python library files to lib/bup/

    authored
    ...and update other programs so that they import them correctly from their
    new location.
    
    This is necessary so that the bup library files can eventually be installed
    somewhere other than wherever the 'bup' executable ends up.  Plus it's
    clearer and safer to say 'from bup import options' instead of just 'import
    options', in case someone else writes an 'options' module.
    
    I wish I could have named the directory just 'bup', but I can't; there's
    already a program with that name.
    
    Also, in the name of sanity, rename memtest.py to 'bup memtest' so that it
    can get the new paths automatically.
Something went wrong with that request. Please try again.