From: zuber Date: Tue, 22 Sep 2009 10:20:49 +0000 (+0200) Subject: Merge branch 'master' of stigma.nowoczesnapolska.org.pl:platforma X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/bc0fad2273183ef161248876a961dd31e4b250fb?hp=9a761497081506a237bcec3319f2608ea7fb4004 Merge branch 'master' of stigma.nowoczesnapolska.org.pl:platforma --- diff --git a/apps/toolbar/fixtures/przyciski.xml b/apps/toolbar/fixtures/przyciski.xml index f359d669..8dc5f27a 100755 --- a/apps/toolbar/fixtures/przyciski.xml +++ b/apps/toolbar/fixtures/przyciski.xml @@ -148,7 +148,7 @@ Podstawowa basic_correction - [["fulltextregexp", {"exprs": [["\ufeff", ""], ["$[\\s]*\\d+[\\s]*^", ""], ["-\\s*^", ""], ["\\,\\.\\.|\\.\\,\\.|\\.\\.\\,", "..."]]}], ["lineregexp", {"exprs": [["^\\s+|\\s+$", ""], ["\\s+", " "], ["(,,)\\s+|\\s+(\")", "$1"], ["(\\d)[\u2014-](\\d)", "$1--$2"], ["\u2014", "---"], ["<(/?)P([aert])", "<$1p$2"], ["([^\\.])(\\s*)</p", "$1.$2</p"]]}]] + [["fulltextregexp", {"exprs": [["\ufeff", ""], ["$[\\s]*\\d+[\\s]*^", ""], ["-\\s*^", ""], ["\\,\\.\\.|\\.\\,\\.|\\.\\.\\,", "..."]]}], ["lineregexp", {"exprs": [["^\\s+|\\s+$", ""], ["\\s+", " "], ["(,,)\\s+|\\s+(\")", "$1"], ["(\\d)[\u2014-](\\d)", "$1--$2"], ["\u2014", "---"], ["<(/?)P([aert])", "<$1p$2"], ["([^\\.])(\\s*)</p", "$1.$2</p"], ["([,\\.:;!\\?])([^\\s\\\\])", "$1 $2"], ["([^\\s])\\s+([,\\.:;!\\?])", "$1$2"]]}]] macro @@ -990,7 +990,7 @@ Zamień dywiz zamien_dywiz - {"exprs": [["(\\s)-(\\s)", "$1---$2"], ["^(\\s*)-(\\s)", "$1---$2"], ["(\\s)-(\\s*)$", "$1---$2"], ["(\\d)[\u2014-](\\d)", "$1--$2"], ["\u2014", "---"]]} + {"exprs": [["(\\s)-(\\s)", "$1---$2"], ["^(\\s*)-(\\s)", "$1---$2"], ["(\\s)-(\\s*)$", "$1---$2"], ["(\\d)[\u2014\u2013\u2010-](\\d)", "$1--$2"], ["\u2014\u2013\u2010", "---"]]} lineregexp @@ -1015,39 +1015,49 @@ var texteditor = panel.texteditor; - var text = texteditor.selection(); - -var out = '<'+params.tag; - +var start_tag = '<'+params.tag; for (var attr in params.attrs) { - - out += ' '+attr+'="' + params.attrs[attr] + '"'; - + start_tag += ' '+attr+'="' + params.attrs[attr] + '"'; }; +start_tag += '>'; +var end_tag = '</'+params.tag+'>'; + +if(text.length > 0) { +// tokenize +var output = '' +var token = '' +for(var index=0; index < text.length; index++) +{ + if (text[index].match(/\s/)) { // whitespace + token += text[index]; + } + else { // character + output += token; + if(output == token) output += start_tag; + token = '' + output += text[index]; + } +} -out += '>'; - -out += text; - -out += '</' + params.tag + '>'; - - - -texteditor.replaceSelection(out); - +if( output[output.length-1] == '\\' ) { + output = output.substr(0, output.length-1) + end_tag + '\\'; +} else { + output += end_tag; +} +output += token; +} +else { + output = start_tag + end_tag; +} +texteditor.replaceSelection(output); if (text.length == 0) { - var pos = texteditor.cursorPosition(); - texteditor.selectLines(pos.line, pos.character + params.tag.length + 2); - } - - panel.fireEvent('contentChanged'); diff --git a/lib/wlrepo/backend_mercurial.py b/lib/wlrepo/backend_mercurial.py index 12711222..11ecfc79 100644 --- a/lib/wlrepo/backend_mercurial.py +++ b/lib/wlrepo/backend_mercurial.py @@ -161,6 +161,9 @@ class MercurialLibrary(wlrepo.Library): def _filectx(self, fileid, branchid): return self._hgrepo.filectx(fileid, changeid=branchid) + + def _changectx(self, nodeid): + return self._hgrepo.changectx(nodeid) # # BASIC BRANCH routines @@ -239,7 +242,7 @@ class MercurialCabinet(wlrepo.Cabinet): if selector is not None: raise NotImplementedException() - return MercurialShelf(self, self._hgtip()) + return MercurialShelf(self, self._library._changectx(self._branchname)) def documents(self): return self._execute_in_branch(action=lambda l, c: (e[1] for e in l._filelist())) @@ -432,17 +435,20 @@ class MercurialDocument(wlrepo.Document): class MercurialShelf(wlrepo.Shelf): - def __init__(self, cabinet, revision): + def __init__(self, cabinet, changectx): super(MercurialShelf, self).__init__(cabinet) - self._revision = revision + self._changectx = changectx @property def _rev(self): - return _revision + return self._changectx.node() def __str__(self): - return to_hex(self._revision) + return self._changectx.hex() + + def ancestorof(self, other): + pass class MergeStatus(object): def __init__(self, mstatus):