diff -Nru editmoin-1.16/debian/changelog editmoin-1.17/debian/changelog --- editmoin-1.16/debian/changelog 2011-07-06 05:12:40.000000000 +0000 +++ editmoin-1.17/debian/changelog 2011-07-06 05:04:58.000000000 +0000 @@ -1,3 +1,24 @@ +editmoin (1.17-1) unstable; urgency=low + + * New upstream release: + - Use sensible-editor instead of vi to pick up the system level editor + preference. + - Add support for URLs that include query parameters. + * Switch to 3.0 source package format. + * Move inline change to editmoin.1 to 01_man_ids_from_firefox.patch. Also + update it to catch cookies like "MOIN_SESSION_443_ROOT". + * Move moin-plugin.vim into debian/, to work better for 3.0 source. + * debian/control: Bump Standards-Version to 3.9.2. + * Add 02_alternative_cookie_names.patch: Current moin versions use + MOIN_SESSION_80_ROOT or MOIN_SESSION_443_ROOT cookie names. Try these + before the standard MOIN_SESSION cookie. Thanks Andy Whitcroft for the + patch! (LP: #801284) + * debian/editmoin.install, debian/rules: Simplify installation of vim + plugin. + * Add bzr-builddeb configuration (merge mode). + + -- Martin Pitt Wed, 06 Jul 2011 07:04:53 +0200 + editmoin (1.16-1) unstable; urgency=low * New upstream release: diff -Nru editmoin-1.16/debian/control editmoin-1.17/debian/control --- editmoin-1.16/debian/control 2011-07-06 05:12:40.000000000 +0000 +++ editmoin-1.17/debian/control 2011-07-06 05:04:58.000000000 +0000 @@ -6,7 +6,7 @@ python (>= 2.5) Maintainer: Martin Pitt Homepage: http://labix.org/editmoin -Standards-Version: 3.9.1 +Standards-Version: 3.9.2 Vcs-Bzr: http://code.launchpad.net/~pitti/editmoin/debian Package: editmoin diff -Nru editmoin-1.16/debian/editmoin.install editmoin-1.17/debian/editmoin.install --- editmoin-1.16/debian/editmoin.install 2011-07-06 05:12:40.000000000 +0000 +++ editmoin-1.17/debian/editmoin.install 2011-07-06 05:04:58.000000000 +0000 @@ -1,3 +1,4 @@ moin*.vim /usr/share/vim/addons/syntax +debian/moin.vim usr/share/vim/addons/plugin debian/vim-editmoin.yaml usr/share/vim/registry editmoin usr/bin diff -Nru editmoin-1.16/debian/moin.vim editmoin-1.17/debian/moin.vim --- editmoin-1.16/debian/moin.vim 1970-01-01 00:00:00.000000000 +0000 +++ editmoin-1.17/debian/moin.vim 2011-07-06 05:04:58.000000000 +0000 @@ -0,0 +1,3 @@ +au! BufRead,BufNewFile *.moin + \ if getline(1) =~ '^@@ Syntax: 1\.5$' | setf moin1_5 + \ | else | setf moin1_6 | endif diff -Nru editmoin-1.16/debian/patches/01_man_ids_from_firefox.patch editmoin-1.17/debian/patches/01_man_ids_from_firefox.patch --- editmoin-1.16/debian/patches/01_man_ids_from_firefox.patch 1970-01-01 00:00:00.000000000 +0000 +++ editmoin-1.17/debian/patches/01_man_ids_from_firefox.patch 2011-07-06 05:04:58.000000000 +0000 @@ -0,0 +1,27 @@ +Description: Document how to create a .moin_ids from Firefox +Author: Martin Pitt +Bug: https://launchpad.net/bugs/806304 + +Index: debian/editmoin.1 +=================================================================== +--- debian.orig/editmoin.1 2011-07-06 06:47:43.854599539 +0200 ++++ debian/editmoin.1 2011-07-06 06:47:47.754599564 +0200 +@@ -103,6 +103,18 @@ + https://user:password@example.com/moin/moin.cgi 123456789.123.12345 + + .PP ++You can use a command like this to create a ++.B ~/.moin_ids ++file from your current Firefox profile: ++ ++.PP ++sqlite3 -separator ' ' .mozilla/*/*.default/cookies.sqlite \\ ++.BR ++ "SELECT host,value FROM moz_cookies WHERE name LIKE 'MOIN_SESSION'" \\ ++.BR ++ | sed 's_^_https://_' > ~/.moin_ids ++ ++.PP + For using shortcuts (see below), and also for better control, defining + URLs without IDs in that file is valid. + diff -Nru editmoin-1.16/debian/patches/02_alternative_cookie_names.patch editmoin-1.17/debian/patches/02_alternative_cookie_names.patch --- editmoin-1.16/debian/patches/02_alternative_cookie_names.patch 1970-01-01 00:00:00.000000000 +0000 +++ editmoin-1.17/debian/patches/02_alternative_cookie_names.patch 2011-07-06 05:04:58.000000000 +0000 @@ -0,0 +1,33 @@ +Description: Current moin versions use MOIN_SESSION_80_ROOT or MOIN_SESSION_443_ROOT cookie names. Try these before the standard MOIN_SESSION cookie. +Author: Andy Whitcroft +Bug: https://launchpad.net/bugs/801284 + +Index: debian/editmoin +=================================================================== +--- debian.orig/editmoin 2011-07-06 06:53:11.304601803 +0200 ++++ debian/editmoin 2011-07-06 06:53:15.014601829 +0200 +@@ -458,12 +458,22 @@ + # Moin >= 1.7 + cookiename, cookievalue = get_session_cookie(user, url) + urlopener = get_urlopener(url, cookievalue, cookiename) ++ moinfile = fetchfile(urlopener, url, cookievalue, template) + else: + # Moin < 1.7 + cookievalue = get_id(url) +- urlopener = get_urlopener(url, cookievalue) ++ moinfile = None ++ for cookiename in ("MOIN_SESSION_80_ROOT", "MOIN_SESSION_443_ROOT"): ++ try: ++ urlopener = get_urlopener(url, cookievalue, cookiename) ++ moinfile = fetchfile(urlopener, url, cookievalue, template) ++ break ++ except: ++ pass ++ if not moinfile: ++ urlopener = get_urlopener(url, cookievalue) ++ moinfile = fetchfile(urlopener, url, cookievalue, template) + +- moinfile = fetchfile(urlopener, url, cookievalue, template) + try: + page_edited = editfile_func(moinfile) + if page_edited: diff -Nru editmoin-1.16/debian/patches/series editmoin-1.17/debian/patches/series --- editmoin-1.16/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ editmoin-1.17/debian/patches/series 2011-07-06 05:04:58.000000000 +0000 @@ -0,0 +1,2 @@ +01_man_ids_from_firefox.patch +02_alternative_cookie_names.patch diff -Nru editmoin-1.16/debian/rules editmoin-1.17/debian/rules --- editmoin-1.16/debian/rules 2011-07-06 05:12:40.000000000 +0000 +++ editmoin-1.17/debian/rules 2011-07-06 05:04:58.000000000 +0000 @@ -5,7 +5,3 @@ override_dh_auto_install: # setup.py installs too much noise, don't use it - -override_dh_install: - dh_install - install -m 644 -D moin-plugin.vim debian/editmoin/usr/share/vim/addons/plugin/moin.vim diff -Nru editmoin-1.16/debian/source/format editmoin-1.17/debian/source/format --- editmoin-1.16/debian/source/format 2011-07-06 05:12:40.000000000 +0000 +++ editmoin-1.17/debian/source/format 2011-07-06 05:12:40.000000000 +0000 @@ -1 +1 @@ -1.0 +3.0 (quilt) diff -Nru editmoin-1.16/editmoin editmoin-1.17/editmoin --- editmoin-1.16/editmoin 2010-09-15 03:09:26.000000000 +0000 +++ editmoin-1.17/editmoin 2011-04-11 16:51:48.000000000 +0000 @@ -19,7 +19,7 @@ """ __author__ = "Gustavo Niemeyer " -__version__ = "1.16" +__version__ = "1.17" __license__ = "GPL" import tempfile @@ -31,6 +31,7 @@ import subprocess import getpass import Cookie +import urlparse try: from hashlib import md5 except ImportError: @@ -258,6 +259,37 @@ def get_user(moinurl): return get_token_with_url(USERSFILENAME, moinurl) +def extract_args(moinurl): + """Given a URL with a query, strip those that conflict such + as 'action' and extract those that are equivalent to command line + arguments such as 'template'. + + >>> extract_args('https://foo.org/Bar') + ('https://foo.org/Bar', None) + + >>> extract_args('https://foo.org/Baz?action=edit') + ('https://foo.org/Baz', None) + + >>> extract_args('https://foo.org/Dog?action=edit&template=Template') + ('https://foo.org/Dog', 'Template') + """ + parts = urlparse.urlparse(moinurl) + params = urlparse.parse_qs(parts.query) + + # Pull out the template name + template = params.get('template', [None])[0] + + # Delete all parameters that might interfere + for item in "action template".split(): + if item in params: + del params[item] + + # Turn the parameters back into a query string + encoded = urllib.urlencode(params) + + next = urlparse.urlunparse((parts.scheme, parts.netloc, parts.path, parts.params, encoded, parts.fragment)) + return next, template + def translate_shortcut(moinurl): if "://" in moinurl: return moinurl @@ -328,7 +360,7 @@ if moinfile.question: moinfile.answer = raw_input(moinfile.question + " ") filename = moinfile.write_raw() - editor = os.environ.get("EDITOR", "vi") + editor = os.environ.get("EDITOR", "sensible-editor") digest = md5(open(filename).read()).digest() subprocess.call("%s %s" % (editor, filename), shell=True) if digest != md5(open(filename).read()).digest(): @@ -415,6 +447,11 @@ raise Error("Couldn't obtain session cookie from server") def edit(url, template=None, editfile_func=editfile): + url, url_template = extract_args(url) + + if url_template and not template: + template = url_template + url = translate_shortcut(url) user = get_user(url) if user: diff -Nru editmoin-1.16/editmoin.1 editmoin-1.17/editmoin.1 --- editmoin-1.16/editmoin.1 2011-07-06 05:12:40.000000000 +0000 +++ editmoin-1.17/editmoin.1 2011-04-11 16:40:15.000000000 +0000 @@ -103,18 +103,6 @@ https://user:password@example.com/moin/moin.cgi 123456789.123.12345 .PP -You can use a command like this to create a -.B ~/.moin_ids -file from your current Firefox profile: - -.PP -sqlite3 -separator ' ' .mozilla/*/*.default/cookies.sqlite \\ -.BR - "SELECT host,value FROM moz_cookies WHERE name='MOIN_SESSION'" \\ -.BR - | sed 's_^_https://_' > ~/.moin_ids - -.PP For using shortcuts (see below), and also for better control, defining URLs without IDs in that file is valid. diff -Nru editmoin-1.16/moin-plugin.vim editmoin-1.17/moin-plugin.vim --- editmoin-1.16/moin-plugin.vim 2011-07-06 05:12:40.000000000 +0000 +++ editmoin-1.17/moin-plugin.vim 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -au! BufRead,BufNewFile *.moin - \ if getline(1) =~ '^@@ Syntax: 1\.5$' | setf moin1_5 - \ | else | setf moin1_6 | endif diff -Nru editmoin-1.16/PKG-INFO editmoin-1.17/PKG-INFO --- editmoin-1.16/PKG-INFO 2010-09-15 03:10:04.000000000 +0000 +++ editmoin-1.17/PKG-INFO 2011-04-11 16:52:26.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: editmoin -Version: 1.16 +Version: 1.17 Summary: Edit Moin pages remotely with your preferred editor Home-page: http://labix.org/editmoin Author: Gustavo Niemeyer