planetfederal / geogig-py

A Python library to use GeoGit
BSD 3-Clause "New" or "Revised" License
24 stars 14 forks source link

The commit message should be quoted when issued to the gateway server #9

Closed jj0hns0n closed 10 years ago

jj0hns0n commented 10 years ago

Looks like the commit message is not quoted to when passed to the gateway server, so the commit is not processed.

My script looks like this.

from geogitpy.repo import Repository

create an empty repository

repo = Repository('/Users/jj0hns0n/data/repos/jjohnson/pytest', init = True)

import data

repo.importshp("/Applications/GeoServer.app/Contents/MacOS/gs/data_dir/workspaces/opengeo/data/countries.shp")

add unstaged features

repo.add()

commit

repo.commit(message = "Added Countries") print repo.log()

and this is what I see in the geogit-gateway

hedin:geogitpy jj0hns0n$ geogit-gateway Dec 05, 2013 1:43:14 PM py4j.GatewayServer fireServerStarted INFO: Gateway Server Started Dec 05, 2013 1:43:21 PM py4j.GatewayServer fireConnectionStarted INFO: Connection Started Dec 05, 2013 1:43:21 PM py4j.GatewayConnection run INFO: Gateway Connection ready to receive messages init shp import /Applications/GeoServer.app/Contents/MacOS/gs/data_dir/workspaces/opengeo/data/countries.shp add commit -m Added Countries rev-list HEAD --changed

groldan commented 10 years ago

You'll find the problem that the command line is being split into arguments using String.split(" "), so the commit message will be split into multiple unknown arguments. Needs to be fixed.

volaya commented 10 years ago

@groldan You mean geogit has problems with arguments with spaces? I can make

$ geogit commit -m "A message with blank spaces"

and it works fine. That is what is causing Jeff's issue. Is there any other problem in geogit about that?

volaya commented 10 years ago

hmm...actually it works from the command line, but not when calling it from the library. If the commit contains spaces it doesn't work, even if it is quoted. Will check it again to try to find out what's happening

volaya commented 10 years ago

fixed. The gateway can now handle spaces correctly