Several operations need to happen to resource representations between the instant they are retrieved from the source to when they are delivered to the sink.
There is a library interface to git, which could be used to create its own "source". A Mercurial interface will have to wrap the binary for all languages other than Python.