Permalink
Commits on Apr 30, 2010
  1. code clarity: one-letter var carried for too long

    In split-cmd.py, the "w" variable is first seen on line 55 and is kept
    around until line 96. Variables that are sparsely used in a medium
    distance in the code should have a name that carries more sense when
    read on its own.
    
    Change "w" into "pack_writer" to better identify the purpose of the
    variable.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Apr 30, 2010
  2. Avoid len as a variable name

    As discussed earlier on the mailing list, the "len" builtin is used very
    often, and using "len" as a variable name can get confusing.
    
    Change all occurrences of "len" as a variable to "sz" to keep it short
    and meaningful.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Apr 30, 2010
Commits on Apr 28, 2010
  1. adjust .md files to make lexgrog happy

    the whatis(1) tool cannot parse the bup manpages, because there
    are two words before the '-' separator. This patch joins the words
    using another '-', in the same fashion as git, to overcome this
    limitation.
    
    Before:
    
    $ whatis bup fuse
    bup (1)              - Backup program using rolling checksums and git file fo...
    fuse: nothing appropriate.
    $ whatis bup-fuse
    bup-fuse: nothing appropriate.
    
    After:
    
    $ whatis bup-fuse
    bup-fuse (1)         - mount a bup repository as a filesystem
    
    Signed-off-by: Jon Dowland <jmtd@debian.org>
    jmtd committed with Apr 28, 2010
  2. Documentation: some placeholders are lost

    Some pieces of text in the documentation files use the <...> syntax to
    mark named placeholders. However, the conversion done by pandoc from
    Markdown to makefile makes some of these placeholders disappear.
    
    The affected elements are those that contain only characters that could
    be valid for an e-mail address or a URL, but are not supposed to be one
    of both. Also, elements inside `...`-style code blocks are unaffected.
    
    Fix this situation by escaping the < and > characters where the tags
    disappear.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Apr 28, 2010
  3. add -o/--allow-other to bup-fuse

    Setting the fuse option allow_other will fail if user_allow_other
    is not set in fuse.conf.  Add toggle -o/--allow-other to bup-fuse
    (disabled by default).
    
    Signed-off-by: Jon Dowland <jmtd@debian.org>
    jmtd committed with Apr 28, 2010
  4. replace test files with ones made up of bup code

    This is needed to avoid possible questions about licensing in the source
    data file.
    jmtd committed with Apr 28, 2010
Commits on Apr 27, 2010
  1. git log --format= isn't in older git, but git log --pretty=format: is.

    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    committed Apr 27, 2010
Commits on Apr 24, 2010
  1. bup-fuse: friendliness when python-fuse not found

    When used with the Python "fuse" module not installed on the system, the
    bup-fuse command exits with an error.
    
    To avoid confusing (or frustrating?) users, print a friendlier error
    message that better describes what happens.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with Apr 24, 2010
  2. cmd/version, etc: fix version number detection stuff.

    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.
    committed Apr 24, 2010
Commits on Apr 23, 2010
  1. vfs: take advantage of bup chunking to make file seeking faster.

    If you have a huge file, you can now seek around inside it (eg. in 'bup
    fuse') without having to read its entire contents.  Calculating the file
    size is also really fast now.
    
    This makes a bup fuse-mounted filesystem much more useful for real-time
    access.  For example, I was able to connect to an sqlite3 database and have
    it work at a reasonable speed.  (Obviously, since 'bup fuse' is written in
    python and doesn't currently support threading, the speed could still be
    improved, but at least it's no longer godawful.)
    committed Apr 23, 2010
  2. git.CatPipe: more resilience against weird errors.

    Notably, MemoryErrors thrown because the file we're trying to load into
    memory is too big to load all at once.  Now the MemoryError gets thrown, but
    the main program is potentially able to recover from it because CatPipe at
    least doesn't get into an inconsistent state.
    
    Also we can recover nicely if some lamer kills our git-cat-file subprocess.
    
    The AutoFlushIter we were using for this purpose turns out to not have been
    good enough, and it's never been used anywhere but in CatPipe, so I've
    revised it further and renamed it to git.AbortableIter.
    committed Apr 23, 2010
  3. cmd/ftp: 'ls' command should print filenames in columns.

    We use the columnate() function from main.py for this, now moved into
    helpers.py.
    committed Apr 23, 2010
  4. cmd/ftp: if 'get' command returns an error, print it first.

    Previously we would print "Saving 'filename'" even if we were about to
    report that 'filename' doesn't exist or is the wrong file type.
    committed Apr 23, 2010
  5. vfs: cache file sizes in the Node object.

    Since the filesystem is read only, there's no reason to recalculate the file
    size every time someone asks :)
    committed Apr 23, 2010
  6. cmd/fuse: add missing Stat entries to appease older versions of pytho…

    …n-fuse.
    
    python-fuse 0.2-pre3-4ubuntu1 didn't work, now it does.
    python-fuse 0.2-pre3-9 on Debian did work, still does.
    committed Apr 23, 2010
  7. cmd/save: when a file is chunked, mangle its name from * to *.bup

    Files that are already named *.bup are renamed to *.bup.bupl, so that we can
    just always drop either .bup or .bupl from a filename if it's there, and the
    result will be the original filename.
    
    Also updated lib/bup/vfs.py to demangle the names appropriately, and treat
    git trees named *.bup as real chunked files (ie. by joining them back
    together).
    committed Apr 23, 2010
Commits on Apr 14, 2010
Commits on Apr 7, 2010
Commits on Apr 2, 2010
  1. doc: bup-split should mention bup-join (not git-join)

    Kirill Smelkov committed with Apr 2, 2010
Commits on Apr 1, 2010
  1. Merge branch 'master' of /tmp/bup

    * 'master' of /tmp/bup:
      Add a 'make install' target.
    committed Apr 1, 2010
  2. Add a 'make install' target.

    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.
    committed Apr 1, 2010
  3. cmd/fsck: correctly catch nonzero return codes of 'par2 create'.

    Oops; we weren't checking the return value like we should.  Reported by
    Sitaram Chamarty.
    committed Apr 1, 2010
  4. helpers.log(): run sys.stdout.flush() first.

    It's annoying when your log messages come out before stdout messages do.
    But it's equally annoying (and inefficient) to have to flush every time you
    print something.  This seems like a nice compromise.
    committed Apr 1, 2010
  5. Get rid of a sha-related DeprecationWarning in python 2.6.

    hashlib is only available in python 2.5 or higher, but the 'sha' module
    produces a DeprecationWarning in python 2.6 or higher.  We want to support
    python 2.4 and above without any stupid warnings, so let's try using
    hashlib.  If it fails, switch to the old sha module.
    committed Apr 1, 2010
Commits on Mar 25, 2010
  1. Add support for a global --bup-dir or -d argument.

    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>
    rlbdv committed with Mar 25, 2010
  2. Add support for global command-line options (before any subcmd).

    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>
    rlbdv committed with Mar 25, 2010
  3. cmd/help-cmd.py: Use BUP_MAIN_EXE to invoke the correct bup.

    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with Mar 25, 2010
Commits on Mar 23, 2010
Commits on Mar 21, 2010
  1. server: only suggest a max of one pack per receive-objects cycle.

    Since the client only handles one at a time and forgets the others anyway,
    suggesting others is a bit of a waste of time... and because of the cheating
    way we figure out which index to suggest when using a midx, suggesting packs
    is more expensive than it should be anyway.
    
    The "correct" fix in the long term will be to make the client accept
    multiple suggestions at once, plus make midx files a little smarter about
    figuring out which pack is the one that needs to be suggested.  But in the
    meantime, this makes things a little nicer: there are fewer confusing log
    messages from the server, and a lot less disk grinding related to looking
    into which pack to suggest, followed by finding out that we've already
    suggested that pack anyway.
    committed Mar 21, 2010
  2. rbackup-cmd: we can now backup a *remote* machine to a *local* server.

    The -r option to split and save allowed you to backup from a local machine
    to a remote server, but that doesn't always work; sometimes the machine you
    want to backup is out on the Internet, and the backup repo is safe behind a
    firewall.  In that case, you can ssh *out* from the secure backup machine to
    the public server, but not vice versa, and you were out of luck.  Some
    people have apparently been doing this:
    
        ssh publicserver tar -c / | bup split -n publicserver
    
    (ie. running tar remotely, piped to a local bup split) but that isn't
    efficient, because it sends *all* the data from the remote server over the
    network before deduplicating it locally.  Now you can do instead:
    
        bup rbackup publicserver index -vux /
        bup rbackup publicserver save -n publicserver /
    
    And get all the usual advantages of 'bup save -r', except the server runs
    locally and the client runs remotely.
    committed Mar 21, 2010
  3. client: Extract 'bup server' connection code into its own module.

    The screwball function we use to let us run 'bup xxx' on a remote server
    after correctly setting the PATH variable is about to become useful for more
    than just 'bup server'.
    committed Mar 21, 2010
  4. options: allow user to specify an alternative to getopt.gnu_getopt.

    The most likely alternative is getopt.getopt, which doesn't rearrange
    arguments.  That would mean "-a foo -p" is considered as the option "-a"
    followed by the non-option arguments ['foo', '-p'].
    
    The non-gnu behaviour is annoying most of the time, but can be useful when
    you're receiving command lines that you want to pass verbatim to someone
    else.
    committed Mar 21, 2010
  5. save/index/drecurse: correct handling for fifos and nonexistent paths.

    When indexing a fifo, you can try to open it (for security reasons) but it
    has to be O_NDELAY just in case the fifo doesn't have anyone on the other
    end; otherwise indexing can freeze.
    
    In index.reduce_paths(), we weren't reporting ENOENT for reasons I can no
    longer remember, but I think they must have been wrong.  Obviously if
    someone specifies a nonexistent path on the command line, we should barf
    rather than silently not back it up.
    
    Add some unit tests to catch both cases.
    committed Mar 21, 2010
  6. save-cmd: exit nonzero if any errors were encountered.

    Somehow I forgot to do this before.
    committed Mar 21, 2010