From: Ɓukasz Rekucki Date: Mon, 21 Sep 2009 13:32:08 +0000 (+0200) Subject: insert_tag - inserts only end tag, when no text selected - fixed. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/59131c2e9a3e322c745fe05af3ba3cf2b2801622?hp=-c insert_tag - inserts only end tag, when no text selected - fixed. --- 59131c2e9a3e322c745fe05af3ba3cf2b2801622 diff --git a/apps/toolbar/fixtures/przyciski.xml b/apps/toolbar/fixtures/przyciski.xml index 737ef313..8dc5f27a 100755 --- a/apps/toolbar/fixtures/przyciski.xml +++ b/apps/toolbar/fixtures/przyciski.xml @@ -1023,6 +1023,7 @@ for (var attr in params.attrs) { start_tag += '>'; var end_tag = '</'+params.tag+'>'; +if(text.length > 0) { // tokenize var output = '' var token = '' @@ -1044,8 +1045,11 @@ if( output[output.length-1] == '\\' ) { } else { output += end_tag; } - output += token; +} +else { + output = start_tag + end_tag; +} texteditor.replaceSelection(output); 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):